Christian Fredrik Johnsen c6973391f3
pyenv-init | performance improvements (#3136)
* perf: replace a series of if statements with a case block. Add error
handling for case where unknown option is provided.
Same setup as rbenv-init for reading arguments.

* perf, docs: Recommend users to specify the shell for `pyenv init -`
Speeds up the startup by about 40% (in local testing, from ~50ms to ~30ms).
Reflect this in `pyenv init` hint text.

* style: remove unnecessary `root` variable in pyenv-init
* style: remove unnecessary variable declarations at the top of file in pyenv-init.

* perf: replace `cat <<` calls with `echo`
The builtin `echo` is about 100x faster. In tests, saves about 2-3ms.

* docs: document the `pyenv init - <shell>` performance boost in the Advanced Configuration section.

* style: test_helper.bash: avoid unnecessary ".." in produced PATH

* docs: fix a false statement about completions location in the Advanced Configuration section.
2024-12-22 15:23:51 +03:00
..
2021-09-21 05:07:12 +03:00
2018-04-24 00:42:47 +00:00
2021-02-23 22:29:56 +02:00