-
-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
projectile is very slow when working with tramp #234
Comments
Unfortunately I don't use tramp, so I cannot help you with any insight regarding the problem. It's likely that I used something in Projectile that doesn't play well with tramp, but I have no idea what it is. |
There should be an option for this.. I have solved it for myself like this: (defadvice projectile-on (around exlude-tramp activate)
(unless (--any? (and it (file-remote-p it))
(list
(buffer-file-name)
list-buffers-directory
default-directory))
ad-do-it))
|
Anything that uses locate-dominating-file frequently over tramp causes this huge slowdown. |
It might or might not make sense to not even check tramp paths at all when this option is set.. There is more user freedom if the option only applies to projectile-on but having it at a lower lever means that we dont also have to manage it in other packages like here: Malabarba/smart-mode-line#70 |
this improves the performance alot for me by disabling cache invalidation for the most common remote lookups thomasf@45791da The only thing I have tested is having projectile-mode enabled at all while browsing directories with dired and opening some files and it did go from being unusable to tolerable. |
Looks promising. I guess some tramp users should test your patch and share their experience with it. |
thomasf@cbe38ff is almost feature complete, it needs to be able to cache some other calls but in essence this it. Before I make it proper (cleaner code, docstrings, better naming, cache usage control) I would like a code review or comments about the overall structure. The speedup is noticable on local projects with lots of files as well, even when the cache is turned off due to fewer directory traversals. |
I have noticed that my patch changes the behaviour of project root finding since all entries in |
some numbers: Essentially, the deeper down in the directory tree calling is made from the better the improvements are. Unpatched projectile, calling
|
The performance numbers look pretty good. I'll do a review of the code later today. As for the |
would it be ok if .projectile is the only file in project-root-files that allow |
Yeah, I think that would be OK. |
@thomasf I have been testing your patch these last days, and it works pretty good :). With an empty cache, projectile-find-file takes around 3 seconds in a remote project with 5500 files (ssh compression enabled, 60ms ping). After that everything works flawlessly and instantly. |
nice, waiting for this to be merged |
Will there be an easy way to reset the cache? |
yes, I will change how the cache works a bit. Should this cache be controlled by the current cache invalidation commands? I also think the default should be to cache only remote files. |
@bbatsov I have a small problem, My first merge request will not contain the cache code but supporting code that Supposedly the addition of a new defcustom would be the user facing change. (defcustom projectile-project-root-parents-files
'(".projectile" ; projectile project marker)
"A list of files considered to mark the root of a project that
overriding matches for `projectile-project-root-files' in parent
directories."
:group 'projectile
:type '(repeat string))
(defcustom projectile-project-root-files
'(".git" ; Git VCS root dir
".hg" ; Mercurial VCS root dir
".fslckout" ; Fossil VCS root dir
".bzr" ; Bazaar VCS root dir
"_darcs" ; Darcs VCS root dir
"rebar.config" ; Rebar project file
"project.clj" ; Leiningen project file
"pom.xml" ; Maven project file
"build.sbt" ; SBT project file
"build.gradle" ; Gradle project file
"Gemfile" ; Bundler file
"requirements.txt" ; Pip file
"package.json" ; npm package file
"Gruntfile.js" ; Grunt project file
"bower.json" ; Bower project file
"composer.json" ; Composer project file
)
"A list of files considered to mark the root of a project."
:group 'projectile
:type '(repeat string)) Or possibly baking it into the current defcustom like this: (defcustom projectile-project-root-files
'((".projectile" . 'parents) ; projectile project marker)
".git" ; Git VCS root dir
".hg" ; Mercurial VCS root dir
".fslckout" ; Fossil VCS root dir
".bzr" ; Bazaar VCS root dir
"_darcs" ; Darcs VCS root dir
"rebar.config" ; Rebar project file
"project.clj" ; Leiningen project file
"pom.xml" ; Maven project file
"build.sbt" ; SBT project file
"build.gradle" ; Gradle project file
"Gemfile" ; Bundler file
"requirements.txt" ; Pip file
"package.json" ; npm package file
"Gruntfile.js" ; Grunt project file
"bower.json" ; Bower project file
"composer.json" ; Composer project file
)
"A list of files considered to mark the root of a project."
:group 'projectile
:type '(repeat string)) Anyhow, for of this to work
I think that option 1 is the best combined with using the emacs provided Do you have any thoughts on any of this? |
Fixed by #299. |
not really fixed yet but it is a lot snappier. |
Can I test this on a topic branch or something? I use tramp all day and its a pretty bad experience. |
Jaseem, that would be nice, also I'm having problems when working with 2014-09-23 18:27 GMT+04:00 Jaseem Abid [email protected]:
|
I did some investiguation the other day and a simple fix is to disable The slowness mainly comes from all the hooks calling I have ideas about how to fix it but it requires some thinking. A simple idea would be to disable all the project detection until absolutely necessary, e.g if you call C-c p f then we know that now you want to detect a project. The main slowness is simply the modeline and the I was somewhat working on a pull request (https://github.com/Silex/projectile) but I got distracted. We'll see if I can come up with something in the next days. |
Maybe a tramp specific projectile minor mode? |
Then I guess they should start using nfs instead of tramp. This is a much better solution imo. — On Thu, Sep 25, 2014 at 11:01 AM, Jaseem Abid [email protected]
|
I use TRAMP mainly to edit files & run commands over ssh for various servers all over the place at work. I also sometimes edit files over FTP that way. I don't think NFS can replace this workflow. Anyway, I'm almost done with my proof of concept implementation. Watch for the PR that'll reference this issue soonish. |
@bbatsov I'll give it a try and let you know the results. |
When I do projectile-find-file I can see several messages:
Tramp: Inserting
/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'... Tramp: Encoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile...done Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region... Wrote /var/folders/mk/l2wm04594f1_106sn9lj4kd80000gp/T/tramp.436SVy Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region...done Tramp: Inserting
/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'...doneTramp: Inserting
/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'... Tramp: Encoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile...done Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region... Wrote /var/folders/mk/l2wm04594f1_106sn9lj4kd80000gp/T/tramp.436EfB Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region...done Tramp: Inserting
/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'...doneTramp: Inserting
/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'... Tramp: Encoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile...done Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region... Wrote /var/folders/mk/l2wm04594f1_106sn9lj4kd80000gp/T/tramp.436RpH Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region...done Tramp: Inserting
/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'...doneDon't know if this is slow because there are some repeatings but tramp itself is ok, e.g. rgrep works fast.
The text was updated successfully, but these errors were encountered: