From b06737f9a7ca6f0e13d3909f307e4212dd9ac9d9 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Fri, 26 Nov 2021 08:46:34 -0500 Subject: [PATCH] Updated Speed (markdown) --- Speed.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Speed.md b/Speed.md index 7ea2811..0095082 100644 --- a/Speed.md +++ b/Speed.md @@ -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) \ No newline at end of file