Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hryx
Last active May 7, 2019 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hryx/91a656944c55039139391939a052d990 to your computer and use it in GitHub Desktop.
Save hryx/91a656944c55039139391939a052d990 to your computer and use it in GitHub Desktop.
Recursive parser: informal benchmarks
Recorded a few times on Linux 4.15.0-36-generic x86_64 for https://github.com/ziglang/zig/pull/2405
master
COLD:
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
2219.734444 task-clock (msec) # 0.992 CPUs utilized
163 context-switches # 0.073 K/sec
12 cpu-migrations # 0.005 K/sec
90,866 page-faults # 0.041 M/sec
7,143,126,105 cycles # 3.218 GHz (49.70%)
11,240,270,946 instructions # 1.57 insn per cycle (62.03%)
2,047,558,796 branches # 922.434 M/sec (62.12%)
32,063,599 branch-misses # 1.57% of all branches (62.40%)
3,645,931,346 L1-dcache-loads # 1642.508 M/sec (62.64%)
83,575,253 L1-dcache-load-misses # 2.29% of all L1-dcache hits (62.93%)
19,584,018 LLC-loads # 8.823 M/sec (50.31%)
3,440,678 LLC-load-misses # 17.57% of all LL-cache hits (49.90%)
2.236584332 seconds time elapsed
WARM:
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
452.536811 task-clock (msec) # 0.956 CPUs utilized
4 context-switches # 0.009 K/sec
1 cpu-migrations # 0.002 K/sec
2,008 page-faults # 0.004 M/sec
1,326,662,615 cycles # 2.932 GHz (50.44%)
2,448,882,217 instructions # 1.85 insn per cycle (62.80%)
344,589,808 branches # 761.462 M/sec (62.20%)
1,669,445 branch-misses # 0.48% of all branches (62.24%)
1,201,173,869 L1-dcache-loads # 2654.312 M/sec (62.21%)
1,928,515 L1-dcache-load-misses # 0.16% of all L1-dcache hits (62.53%)
203,233 LLC-loads # 0.449 M/sec (50.21%)
100,117 LLC-load-misses # 49.26% of all LL-cache hits (50.17%)
0.473131738 seconds time elapsed
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
433.669574 task-clock (msec) # 0.962 CPUs utilized
3 context-switches # 0.007 K/sec
0 cpu-migrations # 0.000 K/sec
2,014 page-faults # 0.005 M/sec
1,299,449,210 cycles # 2.996 GHz (48.42%)
2,464,661,587 instructions # 1.90 insn per cycle (61.32%)
349,333,229 branches # 805.529 M/sec (63.06%)
1,735,040 branch-misses # 0.50% of all branches (63.92%)
1,219,205,504 L1-dcache-loads # 2811.370 M/sec (64.02%)
1,860,558 L1-dcache-load-misses # 0.15% of all L1-dcache hits (63.59%)
202,787 LLC-loads # 0.468 M/sec (48.97%)
69,062 LLC-load-misses # 34.06% of all LL-cache hits (48.02%)
0.450981455 seconds time elapsed
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
453.594319 task-clock (msec) # 0.957 CPUs utilized
4 context-switches # 0.009 K/sec
0 cpu-migrations # 0.000 K/sec
2,014 page-faults # 0.004 M/sec
1,313,192,442 cycles # 2.895 GHz (49.78%)
2,462,515,528 instructions # 1.88 insn per cycle (62.52%)
344,646,946 branches # 759.813 M/sec (62.51%)
1,662,326 branch-misses # 0.48% of all branches (62.57%)
1,194,718,765 L1-dcache-loads # 2633.893 M/sec (62.91%)
1,859,221 L1-dcache-load-misses # 0.16% of all L1-dcache hits (62.57%)
192,276 LLC-loads # 0.424 M/sec (49.86%)
96,924 LLC-load-misses # 50.41% of all LL-cache hits (49.80%)
0.474173647 seconds time elapsed
stage2-recursive-parser
COLD:
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
2043.868024 task-clock (msec) # 0.993 CPUs utilized
195 context-switches # 0.095 K/sec
26 cpu-migrations # 0.013 K/sec
97,058 page-faults # 0.047 M/sec
6,601,643,337 cycles # 3.230 GHz (49.41%)
9,930,424,122 instructions # 1.50 insn per cycle (62.57%)
1,840,043,890 branches # 900.275 M/sec (62.93%)
32,614,553 branch-misses # 1.77% of all branches (62.93%)
2,851,094,866 L1-dcache-loads # 1394.951 M/sec (63.02%)
81,930,149 L1-dcache-load-misses # 2.87% of all L1-dcache hits (62.93%)
19,751,769 LLC-loads # 9.664 M/sec (49.39%)
3,821,134 LLC-load-misses # 19.35% of all LL-cache hits (49.39%)
2.059172086 seconds time elapsed
WARM:
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
230.885644 task-clock (msec) # 0.919 CPUs utilized
3 context-switches # 0.013 K/sec
0 cpu-migrations # 0.000 K/sec
2,007 page-faults # 0.009 M/sec
583,097,602 cycles # 2.525 GHz (49.59%)
1,050,203,185 instructions # 1.80 insn per cycle (63.13%)
149,826,119 branches # 648.919 M/sec (62.73%)
440,715 branch-misses # 0.29% of all branches (62.96%)
433,509,491 L1-dcache-loads # 1877.594 M/sec (63.25%)
1,761,815 L1-dcache-load-misses # 0.41% of all L1-dcache hits (62.93%)
196,284 LLC-loads # 0.850 M/sec (49.40%)
87,977 LLC-load-misses # 44.82% of all LL-cache hits (49.14%)
0.251337536 seconds time elapsed
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
214.162222 task-clock (msec) # 0.910 CPUs utilized
15 context-switches # 0.070 K/sec
2 cpu-migrations # 0.009 K/sec
2,006 page-faults # 0.009 M/sec
592,799,072 cycles # 2.768 GHz (46.38%)
1,078,647,247 instructions # 1.82 insn per cycle (59.43%)
165,122,600 branches # 771.016 M/sec (60.65%)
483,221 branch-misses # 0.29% of all branches (62.61%)
424,791,341 L1-dcache-loads # 1983.503 M/sec (65.84%)
2,038,256 L1-dcache-load-misses # 0.48% of all L1-dcache hits (65.47%)
243,603 LLC-loads # 1.137 M/sec (50.52%)
100,495 LLC-load-misses # 41.25% of all LL-cache hits (48.53%)
0.235312510 seconds time elapsed
Performance counter stats for 'bin/zig test ../std/zig/parser_test.zig':
244.886534 task-clock (msec) # 0.930 CPUs utilized
18 context-switches # 0.074 K/sec
1 cpu-migrations # 0.004 K/sec
2,001 page-faults # 0.008 M/sec
595,212,664 cycles # 2.431 GHz (48.41%)
1,089,535,586 instructions # 1.83 insn per cycle (61.49%)
146,727,209 branches # 599.164 M/sec (61.92%)
394,277 branch-misses # 0.27% of all branches (62.97%)
392,531,249 L1-dcache-loads # 1602.911 M/sec (63.95%)
1,713,542 L1-dcache-load-misses # 0.44% of all L1-dcache hits (64.16%)
275,768 LLC-loads # 1.126 M/sec (50.06%)
72,926 LLC-load-misses # 26.44% of all LL-cache hits (48.54%)
0.263231938 seconds time elapsed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment