Hi:
This recent fix has led to a performance regression in zsh: 49792:
Non-interative shell input is line buffered.
I had noticed that my shell was loading slower and found this Gentoo
bug report (https://bugs.gentoo.org/839900). They had recently picked
up this patch to apply to the current 5.8.1 version.
I've benchmarked loading zsh with the test release and a couple of
previous versions with my zsh configuration:
Benchmark 1: prefix/5.8/bin/zsh -i -c exit
Time (mean ± σ): 262.6 ms ± 10.7 ms [User: 184.7 ms, System:
66.4 ms]
Range (min … max): 246.7 ms … 279.4 ms 11 runs
Benchmark 2: prefix/5.8.1/bin/zsh -i -c exit
Time (mean ± σ): 226.5 ms ± 6.0 ms [User: 155.7 ms, System:
57.4 ms]
Range (min … max): 216.6 ms … 238.5 ms 13 runs
Benchmark 3: prefix/5.8.1.2-test/bin/zsh -i -c exit
Time (mean ± σ): 2.088 s ± 0.027 s [User: 0.503 s, System: 1.562 s]
Range (min … max): 2.056 s … 2.149 s 10 runs
Summary
'prefix/5.8.1/bin/zsh -i -c exit' ran
1.16 ± 0.06 times faster than 'prefix/5.8/bin/zsh -i -c exit'
9.22 ± 0.27 times faster than 'prefix/5.8.1.2-test/bin/zsh -i -c exit'
I've also generated some flamegraphs of the same commands, which I've
attached. The test version now spends most of its time doing the
reads.
Jordan
Attachment:
zsh-5.8.1.svg
Description: image/svg
Attachment:
zsh-5.8.1.2-test.svg
Description: image/svg
Attachment:
zsh-5.8.svg
Description: image/svg