3 ms·
It is quite measurable. Some details. At the top of .zshenv zmodload zsh/datetime [[ -v ZSH_TIME_STARTUP ]] && t0=$EPOCHREALTIME and at the bottom o
by cb321 4y ago
It is quite measurable. Some details. At the top of .zshenv
zmodload zsh/datetime
[[ -v ZSH_TIME_STARTUP ]] && t0=$EPOCHREALTIME
and at the bottom of .zshrc
[[ -v ZSH_TIME_STARTUP ]] && echo $[EPOCHREALTIME-t0]
This is better than alternatives mentioned here which also time .zlogout - i.e. start up & shut down. Now, when I do something like
(repeat 20 ZSH_TIME_STARTUP= zsh -il -c exit)|sort -g|head -n5|mnsd
I get
0.03635 +- 0.00034
Now if I
rm .zcompdump.zwc digraphs.zsh.zwc
and then repeat the "mean,std.dev of best 5 out of 20" above, I get
0.07270 +- 0.00015
So, basically 2x faster start up time by just by doing zcompile on those two files. Also, if I re-run the (repeat..) then I get numbers within +- 2..3 std.devs. So, the numbers and run-to-run consistency all get along fine.