This PR includes a bunch of changes detailed below. Up front here are the top level results:
Benchmarks
Initial load
The time to start a new shell (when opening a terminal emulator for the first time, opening a new tmux pane or running zsh). Benchmarked with hyperfine: hyperfine 'zsh -i -c "exit 0"' --warmup 3 --export-markdown startup.md.
Branch
Command
Mean [ms]
Min [ms]
Max [ms]
Relative
curent master
zsh -i -c exit
302.8 ± 27.0
278.9
347.8
1.0
speed (this PR branch)
zsh -i -c exit
91.7 ± 12.0
79.4
144.3
1.0
This PR improves initial load time by ~3x.
Prompt rendering
Time to render a new prompt after running a command. Benchmarked with zsh-prompt-benchmark in two different repositories (this repo & the linux kernel).
Repo
Branch
Latency (ms)
.files (this repo)
current master
219.96
.files (this repo)
speed (this PR branch)
45.67
linux kernel
current master
1536.35
linux kernel
speed (this PR branch)
38.48
This PR improves prompt rendering time by ~5-500x depending on the repo size.
put every zsh function in its own file to be autoloaded. Minimal speed improvement more a general refactoring. Additionally move functions in their respective scope/utility
remove ruby gems from path as this was about ~100ms of initial load time. Doing so breaks usage of tmuxinator. In future changes will either reenable in a more efficient way (possibly using zplugin to asynchronously modify $PATH), install in a different method (not a ruby gem) or use a different tmux session manager.
change fasd initialization to load components and cache results for speed improvements
remove rarely used history-substring-search zsh plugin
This PR includes a bunch of changes detailed below. Up front here are the top level results:
Benchmarks
Initial load
The time to start a new shell (when opening a terminal emulator for the first time, opening a new
tmux
pane or runningzsh
). Benchmarked withhyperfine
:hyperfine 'zsh -i -c "exit 0"' --warmup 3 --export-markdown startup.md
.master
zsh -i -c exit
speed
(this PR branch)zsh -i -c exit
This PR improves initial load time by ~3x.
Prompt rendering
Time to render a new prompt after running a command. Benchmarked with
zsh-prompt-benchmark
in two different repositories (this repo & the linux kernel).master
speed
(this PR branch)master
speed
(this PR branch)This PR improves prompt rendering time by ~5-500x depending on the repo size.
Changelog
spaceship-prompt
topowerlevel10k
for dramatic speed improvementszsh/prompt.zsh
, see details thereantibody
tozplugin
for speed improvement/async loading of pluginszs/plugins.zsh
zsh
function in its own file to be autoloaded. Minimal speed improvement more a general refactoring. Additionally move functions in their respective scope/utilitytmuxinator
. In future changes will either reenable in a more efficient way (possibly usingzplugin
to asynchronously modify$PATH
), install in a different method (not a ruby gem) or use a different tmux session manager.fasd
initialization to load components and cache results for speed improvementshistory-substring-search
zsh plugin