-
-
Notifications
You must be signed in to change notification settings - Fork 421
Make the fish prompt faster #451
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
Conversation
What about What does the hook actually spend much time on? And how much? Could you provide a profile trace? |
Good point; I hadn't thought of that. I'll try to figure out something, if possible.
Sure, here are 10 profile traces of the original |
According to the profiles, almost all the time is spent on an external command (I presume,
So your assessment that we can save lots of time by not calling it in some cases is correct. Though I also see that
|
Which suggests that rather than potentially duplicating existing logic, a more productive way forward might be to concentrate on studying it first -- to find out if it works as intended to begin with and whether it does extraneous work. E.g. if the external |
We aren't merging anything that breaks things. Or we'll be swamped in bug reports that things no longer work and will have to fix that pronto in addition to reputational damages. |
This speeds it up using two methods:
_pyenv_virtualenv_hook
only when$PWD
or$PYENV_VERSION
change. This was taken from fish shell _pyenv_virtualenv_hook slow #338 (comment). Note that this doesn't automatically work when you open a shell in a directory, so this is manually called during shell init.This fixes #338.