-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
helm-projectile-find-file is slow #4207
Comments
I've started from scratch spacemacs and it works as expected - something's wrong with my config. |
The reason the above helped is it cloned the master branch by default. The moment I switched to develop the problem came up again. |
Which OS are you using? There were some changes to projectile caching defaults in develop. See #3802 |
Pasting the result of |
On master, it is fast because caching is enabled. On develop, it is slow because if your project is large, you must wait until Git finish retrieve the file list, and then Projectile processes the file list every single time How many files are there in your project? |
@cpaulik looked at that, I'm using Mac OS, and if I understand correctly the alien stuff is Windows related. System Info
((auto-completion :variables auto-completion-enable-help-tooltip t auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup t)
better-defaults emacs-lisp git markdown org sql
(shell :variables shell-default-height 30 shell-default-position 'bottom shell-default-shell 'ansi-term)
syntax-checking version-control ruby vagrant javascript spotify ycmd python semantic java go clojure chrome yaml jabber xkcd dash deft scala themes-megapack) I have switched back to master branch because of the issue. @tuhdo it takes about the same amount of time regardless of the project size. If it's of any help, here are my projectile and helm projectile versions: projectile-20151130.1039 |
@tuhdo if that's the case, could it be that it's my Git that is slow and slowing projectile down? I could try running the git command that projectile is using and see if that comes back slow. |
@voltecrus Yes, Projectile can only go as fast as Git goes. If your Git project is large, a delay is expected and that's why we enable cache for Projectile. |
@voltecrus @tuhdo you could refer to this link https://github.com/abo-abo/swiper for more information. I use |
I usually work with projects with thousands of files, or many of ten thousands of files, and Projectile works great for me. On small projects, i.e. just thousands of files, it usually takes instant for me to get the file list. For large project (i.e. 30k files), I use caching, and the first time only takes a few seconds. @zilongshanren Counsel lacks many features that I need i.e. switch to other files in a large project, without any configuration, or go to any file at point, even without full path. |
I met this situation when I input the capital letter. env:
|
I too am seeing this. OS: Darwin |
Seeing this again after an upgrade to 105 release on the master branch. System Info
((auto-completion :variables auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup t)
better-defaults emacs-lisp spell-checking git markdown restclient org sql
(shell :variables shell-default-height 30 shell-default-position 'bottom shell-default-shell 'ansi-term)
syntax-checking version-control ruby vagrant javascript spotify ycmd python semantic java go clojure chrome yaml jabber xkcd dash deft scala themes-megapack dockerfile) i.e. it seem to have leaked from the develop branch into master... |
So the offender is this function: (defun projectile-current-project-files ()
"Return a list of files for the current project."
(let ((files (and projectile-enable-caching
(gethash (projectile-project-root) projectile-projects-cache))))
;; nothing is cached
(unless files
(when projectile-enable-caching
(message "Empty cache. Projectile is initializing cache..."))
(setq files (-mapcat #'projectile-dir-files
(projectile-get-project-directories)))
;; cache the resulting list of files
(when projectile-enable-caching
(projectile-cache-project (projectile-project-root) files)))
(projectile-sort-files files))) In particular, since caching has been disabled, it has to get the list of files every time here: (setq files (-mapcat #'projectile-dir-files
(projectile-get-project-directories)) I looked at the issue #3802 and the mentioned reddit thread, but I couldn't find anything that would relate to the code above breaking. |
In other words, the way I understand it, the reddit thread is wrong. Since Meanwhile if you have this problem putting |
Same as fishtreesugar comment above, the search in helm-projectile-find-file seems very slow when I start search with certain uppercase char ("Q"), some other uppercase chars seem fine. Lowercase "q" is fine as well. System Info
(javascript react shell python org html) |
Maybe that slow is related to default shell. I had a lot of plugins in zsh(oh-my-zsh). When I run emacs with zsh as my default shell, helm-projectile-find-file runs with a noticeable delay. I tried to searching code in projectile, but not find anything involving shell invoking. Maybe I'm wrong about this. Anyway, just another option you guys can have a look. |
I can corroborate @EMayej's experience. When using zsh/oh-my-zsh with spacemacs I'm experiencing a very noticeable delay when helm-projectile-find-file runs. Switching to bash results in helm-projectile-find-file responding match faster. System InfoOS: darwin (auto-completion better-defaults dash elixir emacs-lisp erlang git github html javascript latex markdown org python react
(ruby :variables ruby-version-manager 'rbenv)
rust
(shell :variables shell-default-height 30 shell-default-position 'bottom)
spell-checking sql swift syntax-checking version-control vinegar yaml) |
I removed parts of my zsh config until I found what was causing the performance issue I was experiencing. Removing nvm / this line from my zshenv - |
Just FYI in case it helps others, I told emacs to use bash for it's shell with: |
thanks @kelsin that was exactly what I needed. Like ChrisWilding i also had a similar nvm line but for fish shell. Making helm run bash instead made it snappy again |
Just FYI for help others like me that find some problem with this issue. If you are using some kind of hook inside you bash, this will slow down projectile. In that case, inspired by @kelsin I setted in |
On macOS |
I was getting delays of several seconds (>4 seconds) when using I use
to the top of the file so that OMF is only loaded for interactive shells. I'm very glad I decided to look around and found this thread, because those delays were becoming unbearable lol. |
Commenting out NVM in my zsh initialisation also made a significant difference to the speed of this (and launching new terminals/shells in general). |
I confirm I have this issue where helm-projectile-find-file is slow.
System Info 💻
(csv windows-scripts javascript sql autohotkey helm
(auto-completion :variables auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior nil :disabled-for org erc)
(better-defaults :variables better-defaults-move-to-beginning-of-code-first t better-defaults-move-to-end-of-code-first t)
emacs-lisp git markdown org syntax-checking erc rust themes-megapack)
|
I suffered from 5+ delays when doing |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Windows user here. |
helm-projectile-find-file
used to be very snappy once the indexing has been done, now it takes about a second and a half on every invocation. It's a small project, just a handful of files. It almost feels like it tries to index every time I invoke the function.I'm on develop branch. No projectile-related personal configs. It persists after I invalidate the cache.
The text was updated successfully, but these errors were encountered: