purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.41k stars 81 forks source link

Speed issue with exec-path-from-shell-initialize #36

Closed jwintz closed 8 years ago

jwintz commented 8 years ago

Hello Steve,

First of all, many thanks for this excellent package. However, I realize that is slows down my startup time significantly. I have benchmarked using benchmark-init and here is what I've got.

screen shot 2015-11-30 at 19 53 05

On the top is the loading time per require call, on the bottom is the contents of the prolusion-eshell file that uses exec-path-from-shell-initialize. It is 6 times as long as loading my theme.

Is there any way I can speed it up ? Maybe with an autoload at least to defer its loading time when I open an eshell ?

Thanks !

purcell commented 8 years ago

Yep, no surprise -- it involves running external programs and gathering their input. That will always be slower than running quite a lot of elisp directly inside Emacs.

To speed it up, you can do 3 things:

purcell commented 8 years ago

(With your current config, there will be 4 shell commands run -- by following the latter 2 tips, you'll cut that down to 1.)

jwintz commented 8 years ago

Thanks Steve !