oilshell.org
OSH Parser Performance
We time $sh -n $file
for various files under various shells, and repeat then
run under cachegrind for stable metrics.
Source code: oil/benchmarks/osh-parser.sh
Summary
Instructions Per Line (via cachegrind)
Lower numbers are generally better, but each shell recognizes a different
language, and Oil uses a more thorough parsing algorithm. In thousands of
"I refs".
shell label |
total lines |
thousand irefs per line |
bash |
118,863 |
15.3 |
dash |
111,674 |
1.6 |
mksh |
111,674 |
5.7 |
osh-native |
118,863 |
16.3 |
(zsh isn't measured because zsh -n
unexpectedly forks.)
Average Parsing Rate, Measured on Two Machines (lines/ms)
Shell startup time is included in the elapsed time measurements, but long files
are chosen to minimize its effect.
shell label |
total lines |
host hoover |
host lenny |
dash |
111,674 |
3,683 |
3,384 |
mksh |
111,674 |
1,559 |
1,195 |
bash |
118,863 |
1,604 |
566 |
osh-native |
118,863 |
439 |
344 |
zsh |
118,863 |
318 |
286 |
osh-cpython |
118,863 |
12 |
8 |
osh-ovm |
118,863 |
12 |
7 |
Per-File Measurements
Instructions Per Line (in thousands)
bash |
dash |
mksh |
osh-native |
num lines |
filename |
15.6 |
1.3 |
4.4 |
8.4 |
1,679 |
t4014-format-patch.sh |
16.7 |
2.1 |
8.4 |
25.6 |
1,733 |
functions |
23.7 |
NA |
NA |
20.5 |
2,029 |
configure-helper.sh |
17.9 |
2.1 |
8.9 |
24.0 |
2,512 |
abuild |
13.6 |
1.8 |
5.9 |
18.3 |
2,698 |
Build.sh |
13.7 |
1.0 |
3.3 |
5.3 |
3,123 |
t9300-fast-import.sh |
32.0 |
NA |
NA |
30.1 |
5,160 |
test-cmd-util.sh |
18.2 |
1.8 |
6.1 |
17.2 |
9,661 |
ltmain.sh |
17.3 |
1.9 |
6.4 |
18.2 |
20,489 |
configure |
12.9 |
1.5 |
5.4 |
14.6 |
69,779 |
configure-coreutils |
Elapsed Time (milliseconds)
host label |
bash |
dash |
mksh |
zsh |
osh-ovm |
osh-cpython |
osh-native |
osh to bash ratio |
num lines |
filename |
hoover |
2 |
1 |
1 |
27 |
71 |
75 |
3 |
1.8 |
1,679 |
t4014-format-patch.sh |
hoover |
2 |
1 |
2 |
3 |
236 |
228 |
7 |
3.3 |
1,733 |
functions |
hoover |
3 |
NA |
NA |
6 |
248 |
233 |
6 |
2.5 |
2,029 |
configure-helper.sh |
hoover |
3 |
1 |
3 |
4 |
351 |
337 |
8 |
3.1 |
2,512 |
abuild |
hoover |
2 |
1 |
2 |
23 |
255 |
252 |
7 |
3.1 |
2,698 |
Build.sh |
hoover |
2 |
1 |
2 |
32 |
79 |
81 |
3 |
1.6 |
3,123 |
t9300-fast-import.sh |
hoover |
6 |
NA |
NA |
8 |
769 |
708 |
21 |
3.5 |
5,160 |
test-cmd-util.sh |
hoover |
7 |
3 |
8 |
29 |
836 |
824 |
22 |
3.1 |
9,661 |
ltmain.sh |
hoover |
14 |
7 |
15 |
52 |
1,863 |
1,793 |
49 |
3.5 |
20,489 |
configure |
hoover |
34 |
15 |
37 |
190 |
5,269 |
5,056 |
144 |
4.3 |
69,779 |
configure-coreutils |
lenny |
6 |
1 |
1 |
27 |
98 |
97 |
3 |
0.6 |
1,679 |
t4014-format-patch.sh |
lenny |
5 |
1 |
2 |
3 |
365 |
327 |
7 |
1.5 |
1,733 |
functions |
lenny |
7 |
NA |
NA |
6 |
370 |
326 |
7 |
1.0 |
2,029 |
configure-helper.sh |
lenny |
7 |
1 |
3 |
5 |
543 |
494 |
9 |
1.4 |
2,512 |
abuild |
lenny |
5 |
1 |
3 |
25 |
409 |
355 |
9 |
1.8 |
2,698 |
Build.sh |
lenny |
5 |
1 |
2 |
74 |
117 |
118 |
4 |
1.0 |
3,123 |
t9300-fast-import.sh |
lenny |
16 |
NA |
NA |
17 |
1,367 |
1,018 |
32 |
2.0 |
5,160 |
test-cmd-util.sh |
lenny |
22 |
4 |
9 |
13 |
1,408 |
1,209 |
26 |
1.2 |
9,661 |
ltmain.sh |
lenny |
40 |
8 |
18 |
47 |
3,097 |
2,643 |
64 |
1.6 |
20,489 |
configure |
lenny |
99 |
16 |
54 |
199 |
8,872 |
7,447 |
183 |
1.8 |
69,779 |
configure-coreutils |
Parsing Rate (lines/ms)
host label |
bash |
dash |
mksh |
zsh |
osh-ovm |
osh-cpython |
osh-native |
num lines |
filename |
hoover |
1,028 |
2,025 |
1,189 |
61 |
24 |
22 |
586 |
1,679 |
t4014-format-patch.sh |
hoover |
828 |
1,752 |
744 |
609 |
7 |
8 |
248 |
1,733 |
functions |
hoover |
811 |
NA |
NA |
338 |
8 |
9 |
322 |
2,029 |
configure-helper.sh |
hoover |
919 |
1,748 |
819 |
635 |
7 |
7 |
297 |
2,512 |
abuild |
hoover |
1,151 |
2,192 |
1,092 |
119 |
11 |
11 |
376 |
2,698 |
Build.sh |
hoover |
1,674 |
3,727 |
1,757 |
98 |
40 |
38 |
1,030 |
3,123 |
t9300-fast-import.sh |
hoover |
870 |
NA |
NA |
612 |
7 |
7 |
249 |
5,160 |
test-cmd-util.sh |
hoover |
1,334 |
3,114 |
1,160 |
335 |
12 |
12 |
434 |
9,661 |
ltmain.sh |
hoover |
1,463 |
3,145 |
1,338 |
395 |
11 |
11 |
416 |
20,489 |
configure |
hoover |
2,067 |
4,538 |
1,889 |
367 |
13 |
14 |
485 |
69,779 |
configure-coreutils |
lenny |
302 |
2,717 |
1,314 |
62 |
17 |
17 |
495 |
1,679 |
t4014-format-patch.sh |
lenny |
372 |
1,972 |
767 |
576 |
5 |
5 |
243 |
1,733 |
functions |
lenny |
297 |
NA |
NA |
322 |
5 |
6 |
284 |
2,029 |
configure-helper.sh |
lenny |
368 |
2,097 |
725 |
484 |
5 |
5 |
267 |
2,512 |
abuild |
lenny |
545 |
2,669 |
956 |
107 |
7 |
8 |
301 |
2,698 |
Build.sh |
lenny |
681 |
3,308 |
1,832 |
42 |
27 |
26 |
703 |
3,123 |
t9300-fast-import.sh |
lenny |
318 |
NA |
NA |
301 |
4 |
5 |
162 |
5,160 |
test-cmd-util.sh |
lenny |
445 |
2,386 |
1,035 |
737 |
7 |
8 |
375 |
9,661 |
ltmain.sh |
lenny |
518 |
2,493 |
1,114 |
440 |
7 |
8 |
320 |
20,489 |
configure |
lenny |
703 |
4,338 |
1,287 |
351 |
8 |
9 |
381 |
69,779 |
configure-coreutils |
Memory Usage (Max Resident Set Size in MB)
Again, Oil uses a different algorithm (and language) than POSIX shells. It
builds an AST in memory rather than just validating the code line-by-line.
Shell and Host Details
Raw Data