Daniel Hahler
|
44c20af80e
|
Optimize pyenv-which: implement remove_from_path in Bash
This greatly improves the performance of `pyenv virtualenvwrapper_lazy`,
which happens to call pyenv-which a lot.
For profiling I've initially used:
% zmodload zsh/zprof
% eval "$(pyenv init -)"
% pyenv virtualenvwrapper_lazy
Before:
% zprof|grep -E '(pyenv|virtualenv)'
1) 1 754,07 754,07 58,95% 751,50 751,50 58,75% pyenv
21) 1 2,57 2,57 0,20% 2,57 2,57 0,20% virtualenvwrapper_setup_lazy_loader
1) 1 754,07 754,07 58,95% 751,50 751,50 58,75% pyenv
1/1 2,57 2,57 0,20% 2,57 2,57 virtualenvwrapper_setup_lazy_loader [21]
1/1 2,57 2,57 0,20% 2,57 2,57 pyenv [1]
21) 1 2,57 2,57 0,20% 2,57 2,57 0,20% virtualenvwrapper_setup_lazy_loader
After:
% zprof|grep -E '(pyenv|virtualenv)'
1) 1 383,30 383,30 27,97% 380,88 380,88 27,79% pyenv
31) 1 2,42 2,42 0,18% 2,42 2,42 0,18% virtualenvwrapper_setup_lazy_loader
1) 1 383,30 383,30 27,97% 380,88 380,88 27,79% pyenv
1/1 2,42 2,42 0,18% 2,42 2,42 virtualenvwrapper_setup_lazy_loader [31]
1/1 2,42 2,42 0,18% 2,42 2,42 pyenv [1]
31) 1 2,42 2,42 0,18% 2,42 2,42 0,18% virtualenvwrapper_setup_lazy_loader
Fixes https://github.com/yyuu/pyenv-virtualenvwrapper/issues/13
|
2014-03-13 19:21:32 +01:00 |
|