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 OSH uses a more thorough parsing algorithm. In thousands of
"I refs".
shell label |
total lines |
thousand irefs per line |
bash |
118,863 |
15.1 |
dash |
111,674 |
2.3 |
osh-native |
118,863 |
12.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 no-host |
dash |
111,674 |
3,895 |
bash |
118,863 |
1,009 |
osh-native |
118,863 |
641 |
osh-cpython |
118,863 |
15 |
Per-File Measurements
Time and Memory
shell label |
elapsed ms |
user ms |
sys ms |
max rss MB |
num lines |
filename |
dash |
1 |
1 |
0 |
2 |
2,698 |
Build.sh |
bash |
3 |
3 |
0 |
3 |
2,698 |
Build.sh |
osh-native |
5 |
5 |
0 |
8 |
2,698 |
Build.sh |
osh-cpython |
190 |
186 |
4 |
20 |
2,698 |
Build.sh |
dash |
1 |
1 |
0 |
2 |
2,512 |
abuild |
bash |
4 |
4 |
0 |
3 |
2,512 |
abuild |
osh-native |
6 |
6 |
0 |
9 |
2,512 |
abuild |
osh-cpython |
259 |
247 |
12 |
21 |
2,512 |
abuild |
dash |
7 |
7 |
0 |
2 |
20,489 |
configure |
bash |
22 |
22 |
0 |
4 |
20,489 |
configure |
osh-native |
30 |
25 |
4 |
22 |
20,489 |
configure |
osh-cpython |
1,427 |
1,407 |
20 |
42 |
20,489 |
configure |
dash |
15 |
11 |
4 |
2 |
69,779 |
configure-coreutils |
bash |
55 |
55 |
0 |
3 |
69,779 |
configure-coreutils |
osh-native |
100 |
92 |
8 |
51 |
69,779 |
configure-coreutils |
osh-cpython |
4,409 |
4,356 |
52 |
87 |
69,779 |
configure-coreutils |
bash |
4 |
4 |
0 |
3 |
2,029 |
configure-helper.sh |
osh-native |
4 |
4 |
0 |
8 |
2,029 |
configure-helper.sh |
osh-cpython |
179 |
175 |
4 |
20 |
2,029 |
configure-helper.sh |
dash |
1 |
1 |
0 |
2 |
1,733 |
functions |
bash |
2 |
2 |
0 |
3 |
1,733 |
functions |
osh-native |
5 |
5 |
0 |
8 |
1,733 |
functions |
osh-cpython |
182 |
162 |
20 |
20 |
1,733 |
functions |
dash |
3 |
3 |
0 |
2 |
9,661 |
ltmain.sh |
bash |
13 |
13 |
0 |
4 |
9,661 |
ltmain.sh |
osh-native |
15 |
11 |
4 |
15 |
9,661 |
ltmain.sh |
osh-cpython |
614 |
605 |
8 |
28 |
9,661 |
ltmain.sh |
dash |
1 |
1 |
0 |
2 |
1,679 |
t4014-format-patch.sh |
bash |
2 |
2 |
0 |
3 |
1,679 |
t4014-format-patch.sh |
osh-native |
3 |
3 |
0 |
7 |
1,679 |
t4014-format-patch.sh |
osh-cpython |
64 |
60 |
4 |
18 |
1,679 |
t4014-format-patch.sh |
dash |
1 |
1 |
0 |
2 |
3,123 |
t9300-fast-import.sh |
osh-native |
3 |
3 |
0 |
7 |
3,123 |
t9300-fast-import.sh |
bash |
3 |
3 |
0 |
3 |
3,123 |
t9300-fast-import.sh |
osh-cpython |
65 |
44 |
20 |
18 |
3,123 |
t9300-fast-import.sh |
bash |
10 |
10 |
0 |
3 |
5,160 |
test-cmd-util.sh |
osh-native |
13 |
10 |
3 |
12 |
5,160 |
test-cmd-util.sh |
osh-cpython |
549 |
533 |
16 |
27 |
5,160 |
test-cmd-util.sh |
Instruction Counts
shell label |
irefs |
num lines |
filename |
dash |
6,417,905 |
2,698 |
Build.sh |
bash |
35,933,919 |
2,698 |
Build.sh |
osh-native |
38,345,981 |
2,698 |
Build.sh |
dash |
7,043,427 |
2,512 |
abuild |
bash |
43,752,445 |
2,512 |
abuild |
osh-native |
46,305,718 |
2,512 |
abuild |
dash |
53,264,106 |
20,489 |
configure |
osh-native |
263,775,719 |
20,489 |
configure |
bash |
349,528,134 |
20,489 |
configure |
dash |
151,775,776 |
69,779 |
configure-coreutils |
osh-native |
789,456,989 |
69,779 |
configure-coreutils |
bash |
886,051,458 |
69,779 |
configure-coreutils |
osh-native |
31,315,555 |
2,029 |
configure-helper.sh |
bash |
47,119,656 |
2,029 |
configure-helper.sh |
dash |
4,654,611 |
1,733 |
functions |
bash |
28,153,410 |
1,733 |
functions |
osh-native |
29,521,198 |
1,733 |
functions |
dash |
23,598,849 |
9,661 |
ltmain.sh |
osh-native |
116,722,185 |
9,661 |
ltmain.sh |
bash |
172,845,801 |
9,661 |
ltmain.sh |
dash |
3,168,267 |
1,679 |
t4014-format-patch.sh |
osh-native |
11,898,644 |
1,679 |
t4014-format-patch.sh |
bash |
25,320,150 |
1,679 |
t4014-format-patch.sh |
dash |
4,358,947 |
3,123 |
t9300-fast-import.sh |
osh-native |
14,010,254 |
3,123 |
t9300-fast-import.sh |
bash |
41,145,971 |
3,123 |
t9300-fast-import.sh |
osh-native |
115,051,404 |
5,160 |
test-cmd-util.sh |
bash |
161,991,275 |
5,160 |
test-cmd-util.sh |
Shell and Host Details
Raw Data
raw files