Projectile: Huge startup perfomance impact

Created on 9 Oct 2017  路  4Comments  路  Source: bbatsov/projectile

Expected behavior

Emacs startup is fast

Actual behavior

Startup emacs (with working_dir=home which is default if started via dmenu) does a lot of IO and takes a long while

Steps to reproduce the problem

Start emacs. The projectile project type display for the scratchpad takes a really long time.

Commit

Commit 561d5aa17f7ce01c84b077c3ea2d77e2ae69c095 seems to be causing this. If i checkout the revision before that the problem is gone.

(defun projectile-go-project-p ()
  "Check if a project contains Go source files."
  (cl-some
   (lambda (file)
     (string= (file-name-extension file) "go"))
(projectile-current-project-files)))

This might be the problem but I'm not sure. projectile-current-project-files needs to load all files in my home directory.

Strace shows that the emacs project loads a lot of files on startup. The startup time is probably dependant on the size of the home directory.

Emacs version

25.3

Operating system

Manjaro Linux

Most helpful comment

Adding this to my config solves the problem:

  (setq projectile-mode-line
        '(:eval (format " Projectile[%s]"
                        (projectile-project-name))))

All 4 comments

Adding this to my config solves the problem:

  (setq projectile-mode-line
        '(:eval (format " Projectile[%s]"
                        (projectile-project-name))))

@bomgar

Yes, this work to me. Without this code is impossible to work with projectile enable.

Same, thanks for the workaround. Strangely the commandline emacs (emacs -nw) starts up quickly, but then slows down to a crawl (feels like it's wading through home in the background) while the ui emacs (emacs) seems to do this synchronously and blocks rendering until it's done searching through my home.

I'm using emacs -nw too and startup time is normal, but is very slow to navigate on code with C-p C-n

Was this page helpful?
0 / 5 - 0 ratings