After profiling startup time, I found that "pyenv rehash" is by far the slowest piece. This change skips rehashing on init. See https://github.com/pyenv/pyenv/issues/784#issuecomment-404850327 Also pass the shell explicitly, as suggested in https://github.com/pyenv/pyenv/issues/784#issuecomment-404944318, which provides a modest improvement. In total, this improves startup time from 1s to 0.3s on my machine. Using the following command: python -m timeit "__import__('subprocess').Popen(['zsh', '-i', '-c', 'echo']).communicate()" Result before this change: 10 loops, best of 3: 1 sec per loop Result after this change: 10 loops, best of 3: 334 msec per loopmain
parent
e064d5c65f
commit
dacef14214
Loading…
Reference in new issue