emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: progmodes/project.el and search paths


From: Eric Ludlam
Subject: Re: progmodes/project.el and search paths
Date: Tue, 04 Aug 2015 07:52:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

On 08/03/2015 06:47 PM, Dmitry Gutov wrote:
My
experience has been that tools that depend on a project to ask what the
current project is do so a lot.  As such, I cache the current project,
and current root project as buffer local variables.  Those project
structures then have relevant meta data as well.  Another tactic is
initializing each buffer into a project as it is created.  That moves
search time into a different timing that is less noticeable than
on-demand when the user makes a request.

IME, (vc-call-backend backend 'root dir) takes a negligible amount of time, so we might as well call it once per command. Of course, it might be different when using Tramp, but both Tramp and VC do some caching of their own. Other project implementations are free to employ their own caching methods (might be buffer-local, or if the implementation considers that only one project might be enabled at a time, simply in its own variables).

That is true now for project.el. Once you support 20+ project definitions as in EDE where vc is just one of them, all that negligible time adds up.

Asking all 20+ project definitions to do their own caching is something EDE used to do, and it was a pain to maintain. I recommend against it.

Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]