You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In short: OMP seems to fetch the Python version by calling pyenv version-name, which can take >1 s to execute. This is an extremely long time to wait for the next prompt. Every time I press Enter (of course, it's only when there's Python involved). I understand that it's not OMP that's slow, pyenv is, but OMP could be smarter than to use it when not necessary, i.e. when a python.exe is accessible directly, which is when a virtual environment is active. So, when a venv is active, python.exe --version should be called first instead of pyenv.
More details, possible difficulties, implementation
My system: Powershell on Windows 11; Python versions managed by pyenv-win.
Segments:
ConsoleTitle(true) - 0 ms
Time(true) - 0 ms
Os(true) - 0 ms
Session(true) - 5 ms
Root(false) - 0 ms
Git(false) - 5 ms
Python(true) - 1234 ms
Rust(false) - 4 ms
Status(true) - 0 ms
Path(true) - 5 ms
Battery(false) - 0 ms
Executiontime(false) - 0 ms
Run duration: 1.2366288s
My interpretation is that pyenv version-name was called, which took 1.22s this time. Then perhaps python --version was also called? That only took 8ms. Not sure this means it was called or not. Nevertheless, python.exe --version is much faster than pyenv version-name, this can be tested easily by invoking them. I'm writing python.exe specifically, to avoid calling the pyenv shim.
Since it isn't really OMP's fault, I don't expect OMP to do very complicated things to work around this. My idea is that when we're in an active virtual environment, OMP should call python.exe --version instead of pyenv. It's a reasonable expectation that there's a python executable directly available in a virtual environment, and that it's the correct one to call, even with pyenv present.
I'm not very familiar with situations where the python executable inside a venv has a name different from python.exe. Is it possible? Assuming the possibility that it could be named python3.exe or something else, it might be necessary to have a configuration option to specify the python executable's name. For example, it could be named python_binary as per the similar option in Starfish.
For situtations other than inside an active venv, accessing a/the Python executable directly could be problematic. I don't think that there's a quick solution except for calling pyenv, which is very slow. For such cases, I think it's reasonable to expect the user to either put up with the delay, or change the settings (display_mode or fetch_version) to prevent version fetching.
The text was updated successfully, but these errors were encountered:
Code of Conduct
What would you like to see changed?
In short: OMP seems to fetch the Python version by calling
pyenv version-name
, which can take >1 s to execute. This is an extremely long time to wait for the next prompt. Every time I press Enter (of course, it's only when there's Python involved). I understand that it's not OMP that's slow,pyenv
is, but OMP could be smarter than to use it when not necessary, i.e. when apython.exe
is accessible directly, which is when a virtual environment is active. So, when a venv is active,python.exe --version
should be called first instead ofpyenv
.More details, possible difficulties, implementation
My system: Powershell on Windows 11; Python versions managed by
pyenv-win
.Full OMP debug log
Execution time breakdown:
Some python-related parts in the log:
My interpretation is that
pyenv version-name
was called, which took 1.22s this time. Then perhapspython --version
was also called? That only took 8ms. Not sure this means it was called or not. Nevertheless,python.exe --version
is much faster thanpyenv version-name
, this can be tested easily by invoking them. I'm writingpython.exe
specifically, to avoid calling the pyenv shim.Since it isn't really OMP's fault, I don't expect OMP to do very complicated things to work around this. My idea is that when we're in an active virtual environment, OMP should call
python.exe --version
instead of pyenv. It's a reasonable expectation that there's a python executable directly available in a virtual environment, and that it's the correct one to call, even with pyenv present.I'm not very familiar with situations where the python executable inside a venv has a name different from
python.exe
. Is it possible? Assuming the possibility that it could be namedpython3.exe
or something else, it might be necessary to have a configuration option to specify the python executable's name. For example, it could be namedpython_binary
as per the similar option in Starfish.For situtations other than inside an active venv, accessing a/the Python executable directly could be problematic. I don't think that there's a quick solution except for calling
pyenv
, which is very slow. For such cases, I think it's reasonable to expect the user to either put up with the delay, or change the settings (display_mode
orfetch_version
) to prevent version fetching.The text was updated successfully, but these errors were encountered: