1
0
Fork 0
mirror of synced 2024-11-22 07:25:33 -05:00

Updated Speed (markdown)

Eric Nielsen 2021-11-26 08:46:34 -05:00
parent a902e5597c
commit b06737f9a7

@ -1,7 +1,22 @@
Speed is extremely important and is something Zim takes pride in. Many users of Zsh frameworks complain of the slowness in gaining an interactive session. Below is a load-time comparison of many popular frameworks. Speed is important and is something Zim takes pride in. Many users of Zsh frameworks complain of the slowness in gaining an interactive session. Below is a load-time comparison of many popular frameworks.
The tests were done with almost the exact same modules/plugins. Each load-time test was run 100 times to get the best possible results. The tests were run with `for i in {1..100}; do time zsh -lic 'exit'; done`. The script that generated these results can be found [here](https://github.com/zimfw/zsh-framework-benchmark). The tests were done with almost the exact same modules/plugins. The default configurations for each framework are changed only slightly from their default. This is to match feature-parity against the baseline, Zim. Each load-time test was run 100 times to get the best possible results. The tests were run with the [expect](https://core.tcl-lang.org/expect/index) script below, that measures the time until the first prompt appearance.
The default configurations for each framework are changed only slightly from their default. This is to match feature-parity against the baseline, Zim. ```tcl
#!/usr/bin/expect -f
set wd [file tail [pwd]]
set c0 [clock microseconds]
spawn -noecho zsh -li
expect {
-re {\e]([07]|1337);[^\a]*\a} { exp_continue } ; # match escape sequences to be ignored
$wd { send_error "[expr [clock microseconds] - $c0]\n" } ; # match working dir at prompt
timeout { exit 1 }
}
sleep 1
send "exit\r"
```
The script that generated these results can be found [here](https://github.com/zimfw/zsh-framework-benchmark).
![Zsh frameworks benchmark](https://zimfw.github.io/images/results.svg) ![Zsh frameworks benchmark](https://zimfw.github.io/images/results.svg)