Skip to content

Instantly share code, notes, and snippets.

@tydavis
Created August 2, 2023 22:13
Show Gist options
  • Save tydavis/8659535c6bd3eb45dbbfc485362986af to your computer and use it in GitHub Desktop.
Save tydavis/8659535c6bd3eb45dbbfc485362986af to your computer and use it in GitHub Desktop.
Shell benchmark
$ grep bin /etc/shells | while read -r s; do hyperfine --warmup 3 "$s -i -c 'exit 0'"; done
Benchmark 1: /bin/bash -i -c 'exit 0'
Time (mean ± σ): 2.3 ms ± 0.1 ms [User: 0.5 ms, System: 1.2 ms]
Range (min … max): 2.0 ms … 2.6 ms 656 runs
Benchmark 1: /bin/csh -i -c 'exit 0'
Time (mean ± σ): 2.3 ms ± 0.1 ms [User: 0.6 ms, System: 1.0 ms]
Range (min … max): 2.0 ms … 3.8 ms 711 runs
Benchmark 1: /bin/dash -i -c 'exit 0'
Time (mean ± σ): 0.7 ms ± 0.1 ms [User: 0.2 ms, System: 0.3 ms]
Range (min … max): 0.5 ms … 0.9 ms 1201 runs
Benchmark 1: /bin/ksh -i -c 'exit 0'
Time (mean ± σ): 1.0 ms ± 0.1 ms [User: 0.3 ms, System: 0.5 ms]
Range (min … max): 0.8 ms … 3.4 ms 1085 runs
Benchmark 1: /bin/sh -i -c 'exit 0'
Time (mean ± σ): 2.1 ms ± 0.1 ms [User: 0.5 ms, System: 0.9 ms]
Range (min … max): 1.8 ms … 3.0 ms 760 runs
Benchmark 1: /bin/tcsh -i -c 'exit 0'
Time (mean ± σ): 2.3 ms ± 0.1 ms [User: 0.6 ms, System: 1.0 ms]
Range (min … max): 2.1 ms … 2.8 ms 723 runs
Benchmark 1: /bin/zsh -i -c 'exit 0'
Time (mean ± σ): 70.4 ms ± 0.8 ms [User: 34.5 ms, System: 30.2 ms]
Range (min … max): 69.4 ms … 73.0 ms 42 runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment