-
Notifications
You must be signed in to change notification settings - Fork 1
/
src.html
963 lines (860 loc) · 49.1 KB
/
src.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>GO Benchmark Viewer</title>
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="golang, benchmark">
<meta name="author" content="nidorx - Alex Rodin">
<meta name="copyright" content="Copyright (c) 2022 Alex Rodin"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<!-- INFO --------------------------------------------------------------------------------------------------------------
========================================================================================================================
1. Copy the Benchmark result from the terminal and put it in the "<textarea>" element below
2. Changes the page title, and, if necessary, the "regex"
----------------------------------------------------------------------------------------------------------------------->
<input type="text" id="regex" value="Benchmark(?<GROUP>[^_/]+)(?<NAME>.*)$">
<textarea id="data" data-suffix="_StaticAll">
commit: 7cd9055
commit-time: 2016-02-11T13:25:45-0500
goos: darwin
goarch: amd64
cpu: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
cpu-count: 8
cpu-physical-count: 4
os: Mac OS X 10.11.3
mem: 16 GB
BenchmarkDecode/text=digits/level=speed/size=1e4-8 100 154125 ns/op 64.88 MB/s 40418 B/op 7 allocs/op
BenchmarkDecode/text=digits/level=speed/size=1e5-8 10 1367632 ns/op 73.12 MB/s 41356 B/op 14 allocs/op
BenchmarkDecode/text=digits/level=speed/size=1e6-8 1 13879794 ns/op 72.05 MB/s 52056 B/op 94 allocs/op
BenchmarkDecode/text=digits/level=default/size=1e4-8 100 147551 ns/op 67.77 MB/s 40418 B/op 8 allocs/op
BenchmarkDecode/text=digits/level=default/size=1e5-8 10 1197672 ns/op 83.50 MB/s 41508 B/op 13 allocs/op
BenchmarkDecode/text=digits/level=default/size=1e6-8 1 11808775 ns/op 84.68 MB/s 53800 B/op 80 allocs/op
BenchmarkDecode/text=digits/level=best/size=1e4-8 100 143348 ns/op 69.76 MB/s 40417 B/op 8 allocs/op
BenchmarkDecode/text=digits/level=best/size=1e5-8 10 1185527 ns/op 84.35 MB/s 41508 B/op 13 allocs/op
BenchmarkDecode/text=digits/level=best/size=1e6-8 1 11740304 ns/op 85.18 MB/s 53800 B/op 80 allocs/op
BenchmarkDecode/text=twain/level=speed/size=1e4-8 100 143665 ns/op 69.61 MB/s 40849 B/op 15 allocs/op
BenchmarkDecode/text=twain/level=speed/size=1e5-8 10 1390359 ns/op 71.92 MB/s 45700 B/op 31 allocs/op
BenchmarkDecode/text=twain/level=speed/size=1e6-8 1 12128469 ns/op 82.45 MB/s 89336 B/op 221 allocs/op
BenchmarkDecode/text=twain/level=default/size=1e4-8 100 141916 ns/op 70.46 MB/s 40849 B/op 15 allocs/op
BenchmarkDecode/text=twain/level=default/size=1e5-8 10 1076669 ns/op 92.88 MB/s 43820 B/op 28 allocs/op
BenchmarkDecode/text=twain/level=default/size=1e6-8 1 10106485 ns/op 98.95 MB/s 71096 B/op 172 allocs/op
BenchmarkDecode/text=twain/level=best/size=1e4-8 100 138516 ns/op 72.19 MB/s 40849 B/op 15 allocs/op
BenchmarkDecode/text=twain/level=best/size=1e5-8 10 1227964 ns/op 81.44 MB/s 43316 B/op 25 allocs/op
BenchmarkDecode/text=twain/level=best/size=1e6-8 1 10040347 ns/op 99.60 MB/s 72120 B/op 173 allocs/op
BenchmarkEncode/text=digits/level=speed/size=1e4-8 30 482808 ns/op 20.71 MB/s
BenchmarkEncode/text=digits/level=speed/size=1e5-8 5 2685455 ns/op 37.24 MB/s
BenchmarkEncode/text=digits/level=speed/size=1e6-8 1 24966055 ns/op 40.05 MB/s
BenchmarkEncode/text=digits/level=default/size=1e4-8 20 655592 ns/op 15.25 MB/s
BenchmarkEncode/text=digits/level=default/size=1e5-8 1 13000839 ns/op 7.69 MB/s
BenchmarkEncode/text=digits/level=default/size=1e6-8 1 136341747 ns/op 7.33 MB/s
BenchmarkEncode/text=digits/level=best/size=1e4-8 20 668083 ns/op 14.97 MB/s
BenchmarkEncode/text=digits/level=best/size=1e5-8 1 12301511 ns/op 8.13 MB/s
BenchmarkEncode/text=digits/level=best/size=1e6-8 1 137962041 ns/op 7.25 MB/s
</textarea>
<!--
========================================================================================================================
NO NEED TO CHANGE FROM HERE DOWN
========================================================================================================================
-->
<div id="main" class="container">
<ul id="metadata"></ul>
<div id="tables"></div>
<div id="template" hidden>
<h1>Title</h1>
<table>
<colgroup>
<col style="width:4%">
<col style="width:30%">
<col style="width:13%">
<col style="width:13%">
<col style="width:13%">
<col style="width:13%">
<col style="width:13%">
<col style="width:1%">
</colgroup>
<thead>
<tr>
<th style="text-align: center">#</th>
<th>Name</th>
<th data-sort="Iterations" title="Higher is better" style="text-align: center">
Iterations
</th>
<th data-sort="NsPerOp" title="Lower is better" style="text-align: center">
Time (ns/op)
</th>
<th data-sort="MbPerSec" title="Lower is better" style="text-align: center">
Throughput (MB/s)
</th>
<th data-sort="AllocedBytesPerOp" title="Lower is better" style="text-align: center">
Memory (B/op)
</th>
<th data-sort="AllocsPerOp" title="Lower is better" style="text-align: center">
Allocations (allocs/op)
</th>
<th style="text-align: center"></th>
</tr>
</thead>
<tbody id="tbody"></tbody>
</table>
</div>
</div>
<div id="footer">
<div class="container">
<p>If you are unfamiliar with the <code>go test -bench</code> tool:</p>
<ul>
<li>
The first number is the number of iterations. This number represents the number of time the for loop
has run to obtain the statistics.
</li>
<li>The second column shows the average time in nanoseconds that a single repetition takes.</li>
<li>The third column shows the average total of bytes processed in one iteration.</li>
<li>The fourth number is the amount of heap memory allocated in bytes</li>
<li>The last one the average number of allocations made per repetition.</li>
</ul>
</div>
<svg viewBox="0 0 1431 901" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd"
stroke-linejoin="round" stroke-miterlimit="2">
<path d="M335.6 867.8c-.6-33-1.1-47.7-2.2-69.6-.6-10.6-.7-11.2-2.4-10-1 .7-5.7 4.6-10.6 8.6-15.4 12.5-25.1 16.2-47.4 17.7-12.7.9-17.2 2.1-32 9-7.5 3.5-15.5 6.8-17.8 7.5-3.1.8-15.6.9-45 .4l-40.7-.7-9.5 4c-18.4 7.8-31.9 11-41.5 9.8-9-1.2-21.4-4.4-26.4-7-11.5-5.8-23.1-18.3-38.8-42-19.7-29.6-24.6-42-19.2-48.9 1.2-1.5 4.9-4.1 8.3-5.8 11.3-5.6 11.9-6.4 14.1-17.1 1.2-6 7.3-8.4 13.3-5.3 3.7 2 9.4 8.1 13.4 14.6 4.4 7.1 4.6 7.5 6.9 20.5 2.8 15.5 8.5 38.9 10.8 44 1.8 4 2.4 4.5 7.7 6.1 8.5 2.4 23.5 1.5 32.9-2.1 3.9-1.4 12.2-4 18.5-5.6 11.1-2.9 12.5-3.1 36.5-3.4 35-.4 54.8-3.6 62.5-10.1 7-5.9 28-56.1 35.4-84.8 5.2-19.7 5.7-30.9 2.2-46.5-5.3-23.4-13.3-77.8-14.3-96.6-.6-11.5 1-23.3 6-46l2.2-10-5.1-5.2c-6.2-6.1-11.4-15.1-14.4-24.8-3-9.6-3.8-28.1-1.6-38.4.9-4.1 1.5-7.5 1.3-7.6-.1-.1-3.1-2.2-6.7-4.7-22-15.4-33.1-36.4-33.3-62.8-.1-13.6 1.3-22.8 5.9-37 4.6-14.5 10.8-24.6 21.3-35 10.1-10 18.1-14.9 30.8-19 13.1-4.2 20.8-5.3 38.3-5.3h15.6l2.3-11.1c3.4-16.3 8.6-32.9 13.7-43.4 7.5-15.5 20.5-27 45.1-39.9 8.5-4.4 12.6-7.4 19.3-13.8 5.3-5.1 14.5-12.1 24.5-18.8 18.3-12.1 35.8-26.7 47.2-39.4 11.3-12.7 14.6-15.6 26.8-23.7 18.8-12.5 55-31.8 79.1-42.1 14.6-6.3 23-8.3 62.4-14.9 18.4-3.2 39.1-6.9 46-8.4C689.2.6 690.3.5 723.5.5c35.9 0 51.2.9 82.5 5.1 21.1 2.8 34.6 6 44 10.2 6.9 3.2 34.5 13.3 62 22.7 43.7 15.1 57 19.9 62.5 22.7 14.2 7.1 36.1 24.7 70 56.3 20.2 18.8 22 20.2 42.9 34.5 32.3 22 35.4 26.2 48.7 67.5 12.3 38.2 11 35 14.5 34.8 5.6-.3 24.6 1.7 31.3 3.3 3.6.8 11.2 3.8 16.8 6.5 21.8 10.7 35.3 28.8 43.1 57.8 2.1 8.1 2.6 11.8 2.6 24.1.1 13.4-.1 15.2-2.8 23.3-4.6 14-14.3 27.1-25.6 34.8l-5.1 3.4.8 10c1.3 16.4.8 39-1.1 48.4-1.8 8.9-6.1 19.3-9.2 22.5-1.6 1.7-1.8 3.2-1.6 10.2.4 8.1-1.6 26.9-4.3 40.7-1.3 7-1.3 7.3 1 11.2 1.3 2.2 5.1 7.2 8.5 11 3.4 3.9 7 8.7 8.1 10.8 5.5 10.4 8.6 35.4 7.5 60-1.3 29.3-4.8 40.9-26.6 86.4-8.6 18-11.4 25.6-10.6 29.7.8 4.3 5.3 10.7 10.6 15.1 6.7 5.6 29 20.3 40.9 26.9 7.7 4.4 12.9 8.3 20.5 15.5 13.2 12.5 18.7 15.5 28.1 15.5 12.6-.1 19.7-5.3 28.4-21 7.6-13.7 11-18 26.9-34.5 15.4-15.9 23.6-22.5 35.2-28.4 19.8-10 37.8-9.9 49.2.3 5.7 5.2 7.8 9.2 7.8 15.1 0 5.5-1.3 8.4-6.2 13.7-8.2 8.9-22 16.5-44.2 24.3-13.7 4.9-18.2 7.7-29.8 19.1l-10.6 10.5-4.1 12.8c-2.2 7-5.3 14.6-7 17-6.8 9.8-24.2 23.7-31.5 25.1-2.5.5-5.8-.2-13-2.8-11.8-4.3-21-6.3-35.2-7.5-18.2-1.7-31.8-7.6-66.6-29.4-16.9-10.5-27.8-16.7-29.3-16.7-.3 0-.3 14.5.1 32.3.4 17.7.4 36.1 0 41l-.8 8.7H336.3l-.7-33.2z"
fill="#0a0a0a" fill-rule="nonzero"/>
<g fill="#fefefe" fill-rule="nonzero">
<path d="M348 874.8c0-14.5-.7-42.9-1.5-63.3l-1.4-37 3.7-3c13.5-10.9 22.7-22.5 31.7-39.8 6.6-12.9 6.9-15.6 2.8-35.8-4.9-24.8-3.7-39.6 5.9-75.9 1.7-6.3 3.3-12.5 3.6-13.7.2-1.3.8-2.3 1.1-2.3.4 0 5.4 2.4 11.2 5.4 12.3 6.5 27.3 11.8 41.3 14.8 8.1 1.7 13.6 2.1 27.6 2.2 36.6.1 71.3-8.2 103.4-24.6 10.3-5.3 29.9-17.9 31.3-20.1.4-.6 1.2 2.6 1.9 7.1 2.7 19.2 13 30 32 33.5l6.9 1.3-.3 7.5c-.1 4.1-.7 16.4-1.2 27.4-1.5 32-1.4 37.2 1.4 43.1 6.6 14.1 24 21.9 41 18.4 7.5-1.5 19.9-7.9 26.2-13.4l4.9-4.3 4.4 3.4c9.7 7.4 24.6 12.6 36.1 12.5 15.9-.1 29.1-10.4 33.7-26.4 2.3-8.3 2.8-35.4.9-53.4-.9-8.3-1.6-15.6-1.6-16.2 0-.7 1.2-1.2 2.8-1.2 4.6 0 15.6-2.7 20.5-5 11.2-5.3 19.3-16.8 21.8-31.2.7-4 1.3-7.4 1.5-7.6.1-.2 2.8 1.3 6 3.4 16 10.2 42.3 20.6 65.4 25.8 21.5 4.8 32.9 6 57 6 24.9.1 33.7-1.2 51.9-7.6 21.5-7.5 49.1-24.7 63-39.2 1.9-2 3.8-3.6 4.2-3.6.4 0 1 4.6 1.3 10.3 1.9 28.8 5.2 44.5 12.6 59.2 8 16.1 9.4 22.4 9.4 45.5l.1 19.5-5.1 17.5c-7.1 24.1-9.6 36.5-9.8 48.5-.1 8.7.2 10.6 2.3 14.4 4.8 9.1 17.7 20.5 33.8 30l7.3 4.3.2 43.7.3 43.6v14.95c4.5.9-86 3.267-390.7 3.367L348 914.264V874.8z"/>
<path d="M1288.5 863.9c-9.3-3.7-23.3-6.8-35.4-7.9-19.1-1.6-30.4-6.5-65.8-28.6-10.1-6.3-25.1-15-33.4-19.4-26.6-14.2-40.8-24.9-45.5-34.6-2.5-5-2.6-6.2-2.1-13.4.8-9.8 4.4-26.3 10.4-46.9 4.1-14.3 4.5-16.8 5-29.9.9-23.2-2.5-40.5-10.8-55.7-6.9-12.7-10.5-31.3-11.5-59.5l-.6-16.5 5.8-7c9.6-11.7 18.8-26.7 24.2-39.3l2.3-5.3 4.7.8c2.6.4 11.9.7 20.7.6 15.3-.1 23.9-1.3 32.9-4.9 1.8-.7 1.9-.3 1.2 8.2-.3 4.9-1.8 16.3-3.2 25.4-1.4 9-2.3 17.7-2 19.3.7 3.4 5 9.8 12.9 19 3.3 3.8 6.8 9.2 7.9 11.9 3.2 8.4 4.8 22.9 4.8 42.8 0 34-2.1 41.6-24.5 89.5-5.7 12.1-10.8 23.8-11.4 26-3.6 13.4 1.7 24.2 18.2 36.4 10.2 7.6 27 18.4 38.7 24.9 4.6 2.5 11.7 8.1 18.4 14.2 6.3 5.9 13.5 11.5 17 13.3 5.7 3 6.8 3.2 16.1 3.2 8.9 0 10.6-.3 15.7-2.8 7.4-3.6 15.4-12.4 21.3-23.2 2.6-4.7 6.3-10.7 8.3-13.4 4.6-6 28-30.7 28.5-30.1.2.3 2.3 6 4.5 12.8l4.1 12.2-5.7 3.6c-7.1 4.6-25.8 22.7-28.2 27.4-.9 1.9-3.1 8-4.8 13.5-3.6 11.5-7.2 17.5-14.5 24.1-6.4 5.8-15 11.4-17.4 11.4-1-.1-4-1-6.8-2.1zM77.5 833.4c-10.4-2.2-16.8-5.6-24.2-12.6-7.8-7.5-15.4-17.3-26.3-34-8.1-12.2-18-30.7-18-33.4 0-.7 3.5-3.1 7.8-5.3 10.6-5.3 14.7-10.2 16.4-19.6.4-1.7 1-1.4 4.6 2.4 6.5 7.1 8.7 12.3 11.7 27.6 5.4 28.8 10.4 45.2 14.8 49.4 8 7.5 31.7 8.7 48.8 2.5 19.8-7.2 22.1-7.6 52.9-8.4 46.7-1.3 64-5.5 71.8-17.8 11.3-17.5 31.6-70.9 36.2-94.9 2.9-15.5 2.5-29-1.8-48.8-6.4-30.2-13.7-85.3-12.7-96 .6-6.2 7-40.4 7.7-41 .2-.2 4.1 1 8.8 2.6 10.8 3.6 21.3 5.2 30.7 4.7 4.8-.2 7.3 0 7.3.8 0 .6 2 5.2 4.5 10.2 12.5 25.9 39.2 56.8 62.9 73.1 3.5 2.4 4.6 3.7 4.1 4.9-1.3 3.4-9.5 36.1-11.7 46.7-3.1 15.5-3 31.5.6 49.4 3.5 18.2 3.4 21.5-1 30.4-4.7 9.4-13.2 22.1-18.6 27.7-2.4 2.5-11.1 10.4-19.2 17.5-34.1 29.8-37.2 31.5-62.2 33.5-16.9 1.3-21.2 2.5-36.9 10.2l-13 6.3-44.5.1-44.5.2-12.5 5c-20.9 8.5-29.4 9.8-44.5 6.6zM1375.5 785.8c-3.7-10-4.4-13.2-3.3-13.9 1.9-1.2 2.6-.3 4.3 5.9.9 3.1 1.8 6.5 2.1 7.5.6 2-2.4 2.5-3.1.5zM1380.7 782.6c-.4-1 1.3-2 5.6-3.6 9.5-3.4 23.7-10.8 28.5-14.7 7.2-5.9 8.8-11.1 5.2-17.1-5.7-9.4-24.3-9.7-43.7-.7-8.6 4-10.7 2.9-3.1-1.5 11.9-6.8 25.5-10 34.3-8.1 9.4 2.1 17.5 9.3 17.5 15.5 0 8.6-11.6 18.1-33.3 27.4-5.4 2.3-9.9 4.2-10.1 4.2-.2 0-.6-.6-.9-1.4z"/>
<path d="M1378.2 774.3c-1.1-3.7-.9-5.3 1-5.3 1.7 0 18.1-7.9 20-9.7 2.5-2.2 2.3-5.1-.5-5.8-2.3-.6-10 1.5-19.5 5.4l-5.3 2.1-1.8-4.2-1.8-4.3 4.6-2.4c7.3-3.8 18-7.1 25.1-7.7 5.4-.5 7.5-.3 11.3 1.4 5.1 2.3 9 7.4 8.1 10.7-1 3.7-10.1 11.1-18.6 15.3-8.7 4.2-18.5 8.2-20.4 8.2-.6 0-1.6-1.6-2.2-3.7z"/>
<path d="M1369.6 769.3c-2.3-2.3 4.7-6.4 19.3-11.3 12.2-4.1 11.8-1.5-.6 4.3-10.9 5-18 7.7-18.7 7zM1365.6 756.5c-3.1-9.5-1.6-10.9 2.4-2.1 3.4 7.5 3.5 8.2 1.6 8.9-1.1.4-2.1-1.4-4-6.8zM672.3 707.4c-4.9-1.8-12-8.5-13-12.3-.7-2.6 1.3-60.3 2.3-67.7l.6-4.2 5.8-.6c3.3-.4 8.3-1.4 11.2-2.2 16.2-4.5 24.1-6.3 30.7-6.9l7.3-.7-.3 38.7-.4 38.7-6 5.6c-11.6 10.8-27.3 15.6-38.2 11.6zM754.1 705.5c-8.1-1.8-17.6-6.3-22.2-10.6l-3.7-3.4.5-39.4.6-39.4 7.8.7c9.7.8 44.1 6.5 45.1 7.4.4.4 1.4 8.1 2.3 17.2 2.1 20.4 1.7 45-.9 52.1-4.6 12.6-15.6 18.4-29.5 15.4zM453.8 616.5c-43.5-6.8-87.7-37.3-116.7-80.4-16.4-24.3-20-36.7-20.8-72.2-.6-25.1.4-39.1 4.2-58.4 11.4-57.3 38.8-101 81.4-129.6 49-33 132.7-53.8 248.6-61.9 31.8-2.2 107.8-3.3 140.9-2.1 138.2 5 222.7 27 270 70.2 33.4 30.6 55.2 72.2 63.6 121.3 6 35.2 4 78.4-4.7 99-3.5 8.5-12 22.7-18.8 31.6-26.9 34.8-59.3 57.1-97 66.7-10.5 2.7-12.1 2.8-34 2.8-28.6 0-44.5-2.2-70.4-9.7-18.9-5.4-39.3-14.7-52.6-23.9-6.4-4.4-7.2-5.4-9-10.6-5.2-15.2-21.8-29.7-44.9-38.9l-8-3.3-1.1-4.9c-1.3-5.7-4.1-9.9-9.3-14-17.4-13.8-52.1-18.1-79.7-10-20.3 5.9-32.2 18.1-29.5 30.2l.7 3.3-8.6 3.9c-18.5 8.3-35 22.2-41.9 35.2-2.6 4.9-5.1 7.7-11 12.4-19.6 15.7-43 27.7-68.4 35.4-27.3 8.2-60.7 11.3-83 7.9zm83.7-50.9c29.7-5.2 58.3-17.2 80.7-33.8 11.1-8.2 30.3-25.4 37-33.1 17.2-19.7 27.5-39.9 32.9-64.7 3.1-13.7 3.3-39.7.6-53.3-9.1-44.9-38-81.8-79.8-101.6-39.3-18.7-79.7-19.9-123.9-3.8-66.2 24.1-109.2 65.8-122.5 118.7-3.7 14.8-4.8 24.2-4.7 41 .1 16.9 1.6 28 5.7 40.9 13.5 42.7 49.3 74.4 97.5 86.6 8.3 2.1 12.5 2.8 27.5 4.9 6.1.9 41.3-.4 49-1.8zm413-18.6c37.9-3.7 70.6-17.5 93.5-39.6 18.4-17.7 29.5-39.4 33.7-65.8 2.4-15.5 1.4-48.9-2.1-65.3-14.4-68.2-64.7-110.1-147.6-122.8-14.5-2.2-48.3-3.1-59.1-1.6-47 6.8-86.5 33-109.3 72.8-13.1 22.8-18.3 44.6-17.3 73.1.6 18.3 2.7 29.3 8.7 44.7 9.5 24.5 27.9 48 49.7 63.7 10.4 7.5 35 20.7 48.3 26 32.7 12.8 68.2 18 101.5 14.8z"/>
<path d="M480.2 557.4c-24.5-3.5-48.5-13.1-67.2-26.7-14.4-10.5-30.4-30.5-37-46.3-11.8-28.3-12.8-63.9-2.8-95.3 7.1-22.5 17.4-38.9 35.7-57.1 10.8-10.7 22.1-20.2 22.1-18.7 0 .3-1.6 2.5-3.7 4.9-9.6 11.4-19.2 28.7-24.1 43.5-5.7 16.8-6.7 23.8-6.7 45.3.1 17 .4 20.7 2.4 29 7 28.4 20.6 52 41.3 71.5 26.5 24.9 59.6 38.6 96.8 40.2 13.1.5 30-.6 34.5-2.3.8-.3 1.5-.1 1.5.4 0 1.2-14.5 6.1-25.5 8.7-19.5 4.5-47.9 5.8-67.3 2.9z"/>
<path d="M527.5 535.4c-17.2-2.5-29.8-6.2-43.4-12.5-39.8-18.6-67.6-54.5-74.7-96.4-2.4-14.3-1.5-37.3 2-50.5 6.5-24.4 16.8-42.3 34.5-60.1 34.1-34 84.4-47.5 132.1-35.4 50.9 13 89.1 52.6 99.1 103 2.1 10.4 1.8 36.8-.5 47.3-5.4 25.2-17.3 47-35.6 65.2-18.8 18.9-42.4 31.5-70 37.5-7.3 1.6-36.9 2.9-43.5 1.9zm110.6-82.6c12.1-6 21.1-16.9 24.3-29.3 6.9-26.1-10.1-52-37.1-56.7-21.6-3.7-43.4 9.8-50.3 31.1-1.9 6.1-2.2 8.6-1.8 16.7.5 8.4 1 10.3 4.2 16.9 5.9 11.9 15.2 19.9 28.1 24.1 2.5.9 7.8 1.3 14.6 1.1 9.9-.2 11-.4 18-3.9z"/>
<path d="M627.8 428.4c-3.1-1.6-5.8-6.1-5.8-9.5 0-3.4 3.8-8.6 7.1-9.8 6-2.1 13 1.7 14.4 7.9.9 4-1.7 9.6-5.4 11.4-3.7 2-6.8 2-10.3 0zM912.5 538.4c-18.5-2.1-25.8-4.4-13.7-4.4 10.9 0 27.8-3.4 42.2-8.5 42.7-15.1 77-50.6 89.8-93 4.6-15 5.7-23.3 5.6-41-.1-12.5-.6-18.3-2.3-26.5-4-18.9-11.8-36.8-23.2-53-6.8-9.7-24.4-27.2-33.7-33.5-4-2.7-6.9-5.1-6.4-5.3 1.6-.5 19.7 7.4 28.7 12.5 30.2 17.2 52.1 43.1 62.5 74.1 8.9 26.7 11 65.2 5 90.1-11.9 48.9-53.3 80.6-115 88.1-7.8.9-32.4 1.2-39.5.4z"/>
<path d="M880 522.3c-51.6-3.7-96.5-34.8-116.1-80.3-6.8-15.7-9-26.1-9.6-45-.4-12.4-.1-18.7 1.1-25.5 8.4-48.5 46.6-90.1 95.1-103.6 18.9-5.2 43.3-6.6 62.2-3.3 50.5 8.5 92.4 44.5 106.7 91.4 7.5 24.7 7.2 51.4-.9 75.7-6.1 18.2-15.1 33.4-28.2 47.3-23.4 24.9-54.3 39.8-88.8 43-10.7 1-12.2 1-21.5.3zM980.2 441c12.3-4.6 23.2-15.9 27.4-28.2 2.8-8.2 2.5-21.5-.6-30.1-4.6-12.9-15.6-23.4-29-27.7-5.8-1.9-8.6-2.2-16.4-1.8-8.3.3-10.2.8-16.8 4.1-9.7 4.7-16.8 11.8-21.5 21.5-3.2 6.4-3.7 8.5-4.1 16.4-.6 11.1 1.5 19.5 6.7 27.6 6.5 9.9 17.7 17.9 28.4 20.2 6.7 1.4 19.5.5 25.9-2z"/>
<path d="M971.3 412.5c-3.2-3.2-3.5-3.9-3-7.8 1.5-11.3 16-13.4 20.4-3 2.8 6.9-2.3 14.3-9.9 14.3-3.2 0-4.7-.7-7.5-3.5zM646.5 610.9c-7.7-1.2-15.6-5.1-18.9-9.4-3.6-4.7-6-14.5-5.2-21.5 1.4-11.8 9.9-24.1 23.2-33.6 5.9-4.2 25.7-14.4 28-14.4.6 0 3.8 1.6 7 3.5 21.6 13 61.7 13.9 85.6 1.9 3.7-1.9 8.3-4.7 10.2-6.4l3.4-3.1 6.7 2.5c13 5 22.7 10.7 30.1 18.1 9.9 9.8 11.9 14.3 11.9 27 0 8.9-.4 10.7-2.9 16.3-7.8 17-23.1 20.3-62.1 13.3-30.8-5.5-58.7-5.2-77.3.9-14.3 4.7-29 6.5-39.7 4.9zM290.1 500.9c-22.4-4.4-35.5-15.2-41.9-34.7-2.1-6.5-2.5-9.6-2.6-20.2 0-6.9.2-13 .6-13.5.4-.7 5.1-.6 14.5.3 12 1.1 41.3 1.2 45 .1 1-.3 1.4 5.5 1.7 25.6.3 22.6 1 31.8 3.1 41.3.5 2.1.4 2.2-7.7 2.1-4.6-.1-10.3-.5-12.7-1zM1139 492.1c-3-.3-5.4-1-5.3-1.6 2.4-15 3.4-29.6 3.1-47.7l-.3-20.8 3.5.8c7.5 1.6 29.2.5 45.4-2.2 8.7-1.5 16.1-2.4 16.5-2.1 1.3 1.4.6 41.8-.8 47.5-2.1 8.5-5.5 15.3-8.9 18.2-8.5 7.2-30.1 10.4-53.2 7.9zM279.3 423.4c.3-1.1 1.8-7.3 3.2-13.9 3.6-16.3 10.1-42.3 13-52.1 5.4-17.8 20.8-45.6 47.9-86.6l1.8-2.8-2.8-1.1c-4.2-1.6-17.4-4.9-19.6-4.9-3 0-3-2-.3-14.1 3.6-16.2 8-30.1 12.5-39.5 6.1-12.8 18.3-23.5 39.1-34.8l8.6-4.6.7 3.1c.3 1.7.6 5.7.6 8.8 0 7.9 2.6 31.5 5 45.2 2.3 13.7 6.1 27.2 9.5 34.3l2.5 5.1-2.2 1.5c-16.6 11.1-37 30.2-47.9 45-20.7 28.1-34.8 62.8-40.5 100.2-1.4 8.9-2.2 11.7-3.4 11.7-.8 0-7.5.4-14.9.7-12.7.6-13.3.6-12.8-1.2z"/>
<path d="M256.5 416.7c-24.4-9.9-39.4-26.4-44.1-48.8-4.5-21 2.8-52 16.3-69.9 10.7-14.1 28.1-23.2 49.8-26.1 14.5-1.9 47.4.7 46.8 3.7-.1.6-4.2 7.4-9.1 15.3-5 7.8-11.2 18.3-13.8 23.2l-4.9 8.9-4.5-.7c-18.2-2.6-30.5 2.3-33.8 13.3-2.1 7.1-1.5 16.3 1.3 22.1 2.3 4.5 8.7 11.7 15.2 17l2.2 1.8-2.8 12c-1.6 6.6-3.9 16.4-5.1 21.8-1.7 7.5-2.5 9.7-3.8 9.7-.9 0-5.3-1.5-9.7-3.3zM1141 413.7c-4.7-1-5.5-1.5-5.8-3.7-.9-7.2-5.6-28.7-8.2-37.3-16.7-56.1-53.4-101.8-100.5-125.4-4.9-2.5-9.1-4.6-9.2-4.7-.2-.2 2.4-6.5 5.8-14.2 3.3-7.6 7.8-18.4 10.1-23.9 3.1-7.8 26.3-58 27.3-59.3.1-.2 4.7 2.8 10.1 6.6 5.5 3.8 15 10.4 21.2 14.7 11.5 8 20.7 17.6 25.1 26.3 1 2.1 5.9 16.3 10.9 31.7 5 15.4 9.4 28.8 9.7 29.7.5 1.3 0 1.9-2.2 2.4-7.5 1.6-18 4.6-19.2 5.4-1.1.6.9 5.7 9.8 25 22.5 48.6 29.9 67.4 32.7 83 1.8 10.1 4 41 3.1 43.4-.5 1.3-2 1.6-7.9 1.5-4 0-9.8-.6-12.8-1.2z"/>
<path d="M1173.6 399.3c-.3-4.3-1.1-12.9-1.7-19.1-.6-6.3-.9-11.5-.7-11.6.2-.2 2.8-1.7 5.8-3.4 6.7-3.7 13.5-10.3 16.3-15.7 4.8-9 1.6-22.9-7-30.5-6.5-5.7-12.3-7.3-24.9-6.9l-10.5.4-9.8-21.3c-5.4-11.7-9.6-21.4-9.2-21.6 1.4-.9 16.6-2.6 23.1-2.6 38 0 62.8 18.4 73.6 54.5 2.1 6.9 2.8 11.9 3.1 21.5.6 14.1-.6 20.9-5.4 30.8-3.9 8-15.9 19.8-24.8 24.4-6.3 3.3-22.7 8.8-26 8.8-.9 0-1.5-2.3-1.9-7.7zM402.2 254.3c-6-15.6-10.2-39.8-12.3-70.7l-1.3-17.9 8-7.6c4.7-4.6 14.3-11.9 23.9-18.3 19-12.5 33.2-24.5 51.5-43.5 17.6-18.2 29.4-26 72.5-47.8 36.7-18.6 41.3-20 95-28.9 14.9-2.5 32.8-5.7 39.9-7.1 7-1.4 12.9-2.5 13.1-2.5.7 0 1.5 5.5 3.9 26 5.6 47.8 5.9 52.8 6.1 105.5.1 27.5.5 52.5.9 55.6l.8 5.7-15.8.6c-122.7 5-210.4 22-270.4 52.7-6.4 3.2-12 5.9-12.3 5.9-.3 0-1.9-3.5-3.5-7.7zM1000.4 236c-35.5-13.7-89.9-24.5-147.9-29.4-36.8-3.2-54.1-3.9-98-4l-45-.1-.7-13.5c-.4-7.4-.6-31.7-.6-54 .2-43.2-.6-55.3-6.7-104.9-1.4-10.7-2.2-19.7-1.9-20 1-1.1 51.7-.4 66.4.8 33.4 2.7 58.8 6.4 70.5 10.1 3.3 1 11.4 4.1 18 6.8 10.7 4.4 43.9 16.3 70.5 25.3 20.3 6.8 41.7 14.7 46.6 17.2 11.3 5.7 37.8 27.4 68.6 56.1l15.7 14.6-2.8 6.3c-1.6 3.4-6.3 13.4-10.6 22.2-4.2 8.8-9.8 21.2-12.4 27.5-10 24-18.4 43-19 42.9-.3 0-5.2-1.8-10.7-3.9z"/>
</g>
</svg>
<small id="git-link">This report was generated using the <a href="https://github.com/nidorx/go-bench-viewer"
target="_blank">github.com/nidorx/go-bench-viewer</a></small>
</div>
<div id="form-out">
<div class="container">
<h2>Benchmark Data & Configuration</h2>
<div id="form"></div>
<div id="instructions">
<h3>How to format my data?</h3>
<p>
This tool works very intuitively. Just paste your benchmark result above and use the <strong>Regular
Expression</strong> input to format and group your data. The Regular Expression can <a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences">capture
two groups</a>: <code>NAME</code> and <code>GROUP</code>.
</p>
<p>
These identifiers can appear anywhere in the Benchmark name, the default format is usually
<code>Benchmark(?<GROUP>[^_/]+)(?<NAME>.*)$</code>, that matches titles like <code>BenchmarkDecode/text=digits/level=speed/size=1e5-8</code>.
</p>
<p>
If you have difficulty writing regular expressions, use the <a
href="https://regex101.com">https://regex101.com</a> tool.
</p>
<p>
To make it easier to understand, copy and paste some of the examples below into the form above.
</p>
<strong>Example 1:</strong>
<ul>
<li>
<strong>Source:</strong>
<a href="https://github.com/gin-gonic/go-http-routing-benchmark"
target="_blank">https://github.com/gin-gonic/go-http-routing-benchmark</a>
</li>
<li>
<strong>Regular Expression:</strong>
<input readonly value="Benchmark(?<NAME>.+)_(?<GROUP>.*)$">
</li>
<li>
<strong>Data:</strong>
<textarea readonly class="data-demo">
BenchmarkHttpServeMux_StaticAll 5000 706222 ns/op 96 B/op 6 allocs/op
BenchmarkBeego_StaticAll 2000 1408954 ns/op 482433 B/op 14088 allocs/op
BenchmarkDenco_StaticAll 200000 12679 ns/op 0 B/op 0 allocs/op
BenchmarkGocraftWeb_StaticAll 10000 154142 ns/op 51468 B/op 947 allocs/op
BenchmarkGoji_StaticAll 20000 80518 ns/op 0 B/op 0 allocs/op
BenchmarkGoJsonRest_StaticAll 2000 978164 ns/op 180973 B/op 3945 allocs/op
BenchmarkGorillaMux_StaticAll 1000 1763690 ns/op 71804 B/op 956 allocs/op
BenchmarkHttpRouter_StaticAll 100000 15010 ns/op 0 B/op 0 allocs/op
BenchmarkBeego_Param 500000 5495 ns/op 1165 B/op 14 allocs/op
BenchmarkDenco_Param 5000000 312 ns/op 50 B/op 2 allocs/op
BenchmarkGocraftWeb_Param 1000000 1440 ns/op 684 B/op 9 allocs/op
BenchmarkGoji_Param 5000000 748 ns/op 340 B/op 2 allocs/op
BenchmarkGoJsonRest_Param 500000 6980 ns/op 1787 B/op 29 allocs/op
BenchmarkGorillaMux_Param 1000000 2665 ns/op 780 B/op 7 allocs/op
BenchmarkHttpRouter_Param 20000000 139 ns/op 33 B/op 1 allocs/op
BenchmarkBeego_Parse2Params 200000 9217 ns/op 1935 B/op 28 allocs/op
BenchmarkDenco_Parse2Params 5000000 542 ns/op 115 B/op 3 allocs/op
BenchmarkGocraftWeb_Parse2Params 1000000 1756 ns/op 750 B/op 10 allocs/op
BenchmarkGoji_Parse2Params 2000000 954 ns/op 340 B/op 2 allocs/op
BenchmarkGoJsonRest_Parse2Params 500000 8131 ns/op 2145 B/op 32 allocs/op
BenchmarkGorillaMux_Parse2Params 500000 3623 ns/op 812 B/op 7 allocs/op
</textarea>
</li>
</ul>
<strong>Example 2:</strong>
<ul>
<li>
<strong>Source:</strong>
<a href="https://github.com/cornelk/go-benchmark#hashing-algorithms-that-produce-a-64-bit-hash-of-an-8-byte-input"
target="_blank">https://github.com/cornelk/go-benchmark#hashing-algorithms-that-produce-a-64-bit-hash-of-an-8-byte-input</a>
</li>
<li>
<strong>Regular Expression:</strong>
<input readonly value="Benchmark(?<GROUP>Hashing64)(?<NAME>.*)$">
</li>
<li>
<strong>Data:</strong>
<textarea readonly class="data-demo">
BenchmarkHashing64MD5 10458847 114.8 ns/op 69.71 MB/s
BenchmarkHashing64SHA1 8493391 141.2 ns/op 56.66 MB/s
BenchmarkHashing64SHA256 6398036 187.1 ns/op 42.75 MB/s
BenchmarkHashing64SHA3B224 2091546 573.1 ns/op 13.96 MB/s
BenchmarkHashing64SHA3B256 2102798 569.2 ns/op 14.06 MB/s
BenchmarkHashing64RIPEMD160 3957055 303.1 ns/op 26.40 MB/s
BenchmarkHashing64Blake2B 4042722 296.9 ns/op 26.95 MB/s
BenchmarkHashing64Blake2BSimd 4844781 247.7 ns/op 32.30 MB/s
BenchmarkHashing64Murmur3 25517697 47.19 ns/op 169.52 MB/s
BenchmarkHashing64Murmur3Twmb 25722096 46.34 ns/op 172.65 MB/s
BenchmarkHashing64SipHash 28485819 41.71 ns/op 191.82 MB/s
BenchmarkHashing64XXHash 46363768 25.71 ns/op 311.20 MB/s
BenchmarkHashing64XXHashpier 44888440 26.43 ns/op 302.64 MB/s
</textarea>
</li>
</ul>
<strong>Example 3:</strong>
<ul>
<li>
<strong>Source:</strong>
<a href="https://github.com/smallnest/gosercomp"
target="_blank">https://github.com/smallnest/gosercomp</a>
</li>
<li>
<strong>Regular Expression:</strong>
<input readonly value="Benchmark(?<GROUP>[A-Z][a-z]+)By(?<NAME>.*)$">
</li>
<li>
<strong>Data:</strong>
<textarea readonly class="data-demo">
BenchmarkMarshalByJson-12 14336848 406 ns/op 65.0 marshaledBytes 128 B/op 2 allocs/op
BenchmarkMarshalByXml-12 2366107 2546 ns/op 137 marshaledBytes 4736 B/op 11 allocs/op
BenchmarkMarshalByMsgp-12 75395308 77.2 ns/op 47.0 marshaledBytes 80 B/op 1 allocs/op
BenchmarkMarshalByProtoBuf-12 18706688 320 ns/op 36.0 marshaledBytes 64 B/op 2 allocs/op
BenchmarkMarshalByGogoProtoBuf-12 62550351 95.2 ns/op 36.0 marshaledBytes 48 B/op 1 allocs/op
BenchmarkMarshalByThrift-12 20778853 289 ns/op 63.0 marshaledBytes 64 B/op 1 allocs/op
BenchmarkMarshalByThriftIterator-12 17397620 343 ns/op 63.0 marshaledBytes 248 B/op 6 allocs/op
BenchmarkMarshalByThriftIteratorDynamic-12 16680176 360 ns/op 63.0 marshaledBytes 200 B/op 5 allocs/op
BenchmarkMarshalByThriftIteratorEncoder-12 26840368 253 ns/op 63.0 marshaledBytes 169 B/op 0 allocs/op
BenchmarkUnmarshalByJson-12 4311666 1396 ns/op 248 B/op 9 allocs/op
BenchmarkUnmarshalByXml-12 719829 8465 ns/op 3038 B/op 74 allocs/op
BenchmarkUnmarshalByMsgp-12 45195660 131 ns/op 32 B/op 5 allocs/op
BenchmarkUnmarshalByProtoBuf-12 10638994 557 ns/op 176 B/op 11 allocs/op
BenchmarkUnmarshalByGogoProtoBuf-12 19217240 311 ns/op 160 B/op 10 allocs/op
BenchmarkUnmarshalByThrift-12 7694175 807 ns/op 416 B/op 11 allocs/op
BenchmarkUnmarshalByThriftIterator-12 16212927 371 ns/op 168 B/op 7 allocs/op
BenchmarkUnmarshalByThriftIteratorDynamic-12 6664594 904 ns/op 600 B/op 18 allocs/op
BenchmarkUnmarshalByThriftIteratorDecoder-12 6360967 939 ns/op 632 B/op 19 allocs/op
</textarea>
</li>
</ul>
</div>
</div>
</div>
<script>
const COLORS = [
{pct: 0.0, color: {r: 0xdd, g: 0x95, b: 0xa2}}, // #DD95A2
{pct: 0.5, color: {r: 0xef, g: 0xd8, b: 0x96}}, // #EFD896
{pct: 1.0, color: {r: 0x85, g: 0xcb, b: 0xa3}} // #85CBA3
];
// Configuration Lines: A configuration line is a key-value pair of the form `key: value`
const regExpConfigLine = /([^\s]+)\s*:\s*([^\n]+)/;
// Number of cores (appended to the name of the benchmark function)
const regExpNumberOfCores = /(.*?)(-(\d+))?$/;
// <name> <iterations> <value> <unit> [<value> <unit>...]
const regExpSpaceSplit = /\s+/g;
let GROUPS = {}
const DATASET = [];
const METADATA = [];
// init
init();
function renderMetadata() {
document.getElementById("metadata").innerHTML = METADATA.map((it) => {
return `<li><strong>${it.Key}:</strong>${it.Value}</li>`
}).join('');
}
function toggleGroupRowVisibility(groupKey, entryId, visible) {
let group = GROUPS[groupKey]
let entry = group.Entries.find((entry) => entry.Id === entryId)
if (entry) {
entry.Visible = visible;
if (entry.Visible) {
['NsPerOp', 'MbPerSec', 'Iterations', 'AllocsPerOp', 'AllocedBytesPerOp'].forEach((key) => {
if (entry[key] !== undefined) {
group.MaxFilter[key] = Math.max(group.MaxFilter[key], entry[key])
}
})
} else {
let listVisible = (() => {
let list;
return () => {
if (!list) {
list = group.Entries.filter(it => it.Visible)
}
return list
}
})();
['NsPerOp', 'MbPerSec', 'Iterations', 'AllocsPerOp', 'AllocedBytesPerOp'].forEach((key) => {
if (entry[key] !== undefined && entry[key] >= group.MaxFilter[key]) {
group.MaxFilter[key] = Math.max(...listVisible().map(it => it[key]))
}
})
}
renderGroupRows(group)
}
}
function onChangeGroupSortColumn(group, th) {
let dataset = th.dataset;
let column = dataset.sort;
if (column === group.SortColumn) {
group.SortAsc = !group.SortAsc;
} else {
group.SortColumn = column;
group.SortAsc = false;
}
renderGroupRows(group);
}
function sortGroupEntries(group) {
group.Entries.sort((a, b) => {
if (b.Visible && !a.Visible) {
return 1
}
if (a.Visible && !b.Visible) {
return -1
}
if (group.SortAsc) {
return a[group.SortColumn] - b[group.SortColumn]
} else {
return b[group.SortColumn] - a[group.SortColumn]
}
})
}
function style(value, max, inverted) {
let percent = value / max * 100
let percentMapped = percent / 100;
let barColor = color(inverted ? 1 - percentMapped : percentMapped, 1);
let bgColor = color(inverted ? 1 - percentMapped : percentMapped, 0.2);
let styleBar = `style="width: ${percent.toFixed(2)}%; background-color: ${barColor};"`
return `<td><div class="progress" style="background-color: ${bgColor};"><div class="bar" ${styleBar}`
}
function renderGroupRows(group) {
sortGroupEntries(group)
let tbody = group.$el.querySelector('#tbody')
tbody.innerHTML = group.Entries.map((entry, i) => {
let max = group.Max
if (entry.Visible) {
max = group.MaxFilter
}
let tr = [
`<tr class="${entry.Visible ? '' : 'hidden'}">
<td style="text-align: center"><small>${i + 1}</small></td>
<td>${entry.Name}</td>
${style(entry.Iterations, max.Iterations)}>${entry.Iterations}</div></div></td>
`,
];
if (entry.NsPerOp === undefined) {
tr.push(`<td><div class="progress disabled"><div class="bar">-</div></div></td>`)
} else {
tr.push(`${style(entry.NsPerOp, max.NsPerOp, true)}>${entry.NsPerOp.toFixed(2)}</div></div></td>`)
}
if (entry.MbPerSec === undefined) {
tr.push(`<td><div class="progress disabled"><div class="bar">-</div></div></td>`)
} else {
tr.push(`${style(entry.MbPerSec, max.MbPerSec)}>${entry.MbPerSec.toFixed(2)}</div></div></td>`)
}
if (entry.AllocedBytesPerOp === undefined) {
tr.push(`<td><div class="progress disabled"><div class="bar">-</div></div></td>`)
} else {
tr.push(`${style(entry.AllocedBytesPerOp, max.AllocedBytesPerOp, true)}>${entry.AllocedBytesPerOp}</div></div></td>`)
}
if (entry.AllocsPerOp === undefined) {
tr.push(`<td><div class="progress disabled"><div class="bar">-</div></div></td>`)
} else {
tr.push(`${style(entry.AllocsPerOp, max.AllocsPerOp, true)}>${entry.AllocsPerOp}</div></div></td>`)
}
tr.push(`
<td style="text-align: center">
<input onchange="toggleGroupRowVisibility('${group.Key}', ${entry.Id}, ${!entry.Visible})" type="checkbox" ${entry.Visible ? 'checked' : ''}/>
</td>
</tr>
`)
return tr.join('')
}).join("\n")
}
function createGroup(key) {
return {
Id: `_${(new Date()).getTime()}`,
Name: key !== '_default' ? key : '',
Key: key,
Entries: [],
SortAsc: false,
SortColumn: 'Iterations',
Max: {
NsPerOp: Number.MIN_SAFE_INTEGER,
MbPerSec: Number.MIN_SAFE_INTEGER,
Iterations: Number.MIN_SAFE_INTEGER,
AllocedBytesPerOp: Number.MIN_SAFE_INTEGER,
AllocsPerOp: Number.MIN_SAFE_INTEGER,
}
}
}
function processGroups(regex) {
// remove all
for (const key in GROUPS) {
if (GROUPS[key].$el) {
GROUPS[key].$el.remove()
}
}
// create new
GROUPS = {'_default': createGroup('_default')};
DATASET.forEach((entry) => {
let group = GROUPS['_default']
entry.Name = entry.NameRaw
if (regex) {
let match = entry.NameRaw.match(regex);
if (match && match.groups && match.groups.NAME) {
entry.Name = match.groups.NAME
if (match.groups.GROUP) {
let groupName = match.groups.GROUP
if (!GROUPS[groupName]) {
GROUPS[groupName] = createGroup(groupName)
}
group = GROUPS[groupName]
}
}
}
['NsPerOp', 'MbPerSec', 'Iterations', 'AllocsPerOp', 'AllocedBytesPerOp'].forEach((key) => {
if (entry[key] !== undefined) {
group.Max[key] = Math.max(group.Max[key], entry[key])
}
})
group.Entries.push(entry);
})
// Initialize DOM
let $tables = document.getElementById('tables');
for (const key in GROUPS) {
let group = GROUPS[key]
if (group.Entries.length === 0) {
continue
}
group.MaxFilter = {...group.Max}
let $el = document.getElementById("template").cloneNode(true);
group.$el = $el
$el.id = group.Id
$el.hidden = false
$el.querySelector('h1').innerHTML = group.Name
$el.querySelectorAll('[data-sort]').forEach(th => {
th.onclick = () => {
onChangeGroupSortColumn(group, th)
}
})
$tables.appendChild($el)
renderGroupRows(group)
}
}
// https://go.googlesource.com/proposal/+/master/design/14313-benchmark-format.md
function parseData(report) {
DATASET.splice(0);
METADATA.splice(0);
report
.split("\n")
.map((line) => line.trim())
.filter((line) => line !== '')
.map((line, id) => {
try {
let configMatch = line.match(regExpConfigLine)
if (configMatch) {
// Configuration Lines:
// A configuration line is a key-value pair of the form
// `key: value`
METADATA.push({
Id: id + 1,
Kind: 0,
Key: configMatch[1],
Value: configMatch[2],
})
} else {
// Benchmark Results
// A benchmark result line has the general form
// <name> <iterations> <value> <unit> [<value> <unit>...]
let parts = line.split(regExpSpaceSplit)
if (parts.length % 2 !== 0 || parts.length < 4) {
// The line must have an even number of fields, and at least four.
return undefined;
}
// Number of cores (appended to the name of the benchmark function)
let matchProcess = parts[0].match(regExpNumberOfCores)
let name = matchProcess[1];
let numCores = matchProcess[3];
let metrics = {}
for (let i = 2; i < parts.length; i += 2) {
switch (parts[i + 1]) {
case "ns/op": // Nanoseconds per operation
metrics.NsPerOp = Number.parseFloat(parts[i]);
break
case "MB/s": //
metrics.MbPerSec = Number.parseFloat(parts[i]);
break
case "B/op": // Bytes allocated per operation
metrics.AllocedBytesPerOp = Number.parseInt(parts[i]);
break
case "allocs/op": // Allocations per operation
metrics.AllocsPerOp = Number.parseFloat(parts[i]);
break
default:
// Extra records additional metrics reported by ReportMetric.
// not used yet
if (metrics.Extras === undefined) {
metrics.Extras = {}
}
metrics.Extras[parts[i + 1]] = Number.parseFloat(parts[i]);
}
}
DATASET.push({
Id: id + 1,
Kind: 1,
NameRaw: name,
Cores: numCores,
Iterations: Number.parseInt(parts[1]), // The number of iterations.
Visible: true,
...metrics
})
}
} catch (e) {
console.log(e);
}
})
}
function debounce(callback) {
let timeout
return () => {
clearTimeout(timeout)
timeout = setTimeout(callback, 400)
};
}
function init() {
const inputData = document.getElementById("data");
const inputRegex = document.getElementById("regex");
const form = document.getElementById("form");
form.appendChild(inputData)
form.appendChild(inputRegex)
let parseRegex = () => {
let groupRegex
if (inputRegex.value !== '') {
try {
groupRegex = new RegExp(inputRegex.value)
// validate regex
'BenchmarkDecode/text=twain/level=default/size=1e5'.match(groupRegex)
} catch (e) {
groupRegex = undefined
console.error("Regex Invalid", e)
}
}
processGroups(groupRegex);
};
const parseRegexDebounce = debounce(parseRegex);
const parseFull = debounce(() => {
parseData(inputData.value);
renderMetadata();
parseRegexDebounce()
});
inputData.onchange = parseFull
inputData.oninput = parseFull
inputRegex.onchange = parseRegexDebounce
inputRegex.oninput = parseRegexDebounce
// init
parseData(inputData.value);
renderMetadata();
parseRegex()
}
// https://stackoverflow.com/a/7128796/2204014
function color(percent, alfa) {
let i;
for (i = 1; i < COLORS.length - 1; i++) {
if (percent < COLORS[i].pct) {
break;
}
}
const lower = COLORS[i - 1];
const upper = COLORS[i];
const range = upper.pct - lower.pct;
const rangePct = (percent - lower.pct) / range;
const pctLower = 1 - rangePct;
const pctUpper = rangePct;
const color = {
r: Math.floor(lower.color.r * pctLower + upper.color.r * pctUpper),
g: Math.floor(lower.color.g * pctLower + upper.color.g * pctUpper),
b: Math.floor(lower.color.b * pctLower + upper.color.b * pctUpper)
};
return 'rgba(' + [color.r, color.g, color.b, alfa].join(',') + ')';
}
</script>
<style>
*, ::after, ::before {
box-sizing: border-box;
}
html, body {
overflow-x: hidden;
}
html {
display: block;
}
body {
color: #007D9C;
text-align: left;
background-color: #fff;
/*width: 80%;*/
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
line-height: 1.4;
max-height: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
margin: 0;
}
.container {
flex: 1;
max-width: 55rem;
/*min-width: 55rem;*/
padding: 0 5px;
}
#footer {
display: block;
background-color: #253443;
color: #fff;
flex: 1;
line-height: 2rem;
position: relative;
margin-top: 50px;
border-top: 1px solid #000;
}
#footer .container {
margin-bottom: 1.875rem;
}
#footer svg {
width: 5rem;
position: absolute;
bottom: 0px;
}
#git-link {
opacity: 0.5;
margin-left: 90px;
display: block;
}
#git-link a {
color: #fff;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
h1 {
margin-bottom: 0;
font-size: 24px;
}
table {
background-color: transparent;
border-spacing: 0;
border: 1px solid #e9ecef;
display: block;
margin: 0 auto;
}
table thead th {
border-bottom: 2px solid #dee2e6;
border-top: 0;
font-size: 0.8em;
}
tbody tr:hover td {
background-color: #DEF3FF;
}
th {
text-align: inherit;
}
td, th {
padding: 2px;
vertical-align: middle;
border-top: 1px solid #dee2e6;
}
td small {
color: #253443;
}
td i:before, td i:after {
background-color: #fff;
border-color: #fff;
color: #fff;
content: "";
position: absolute;
display: block;
box-sizing: border-box;
}
td i {
font-size: 32px;
color: transparent;
user-select: none;
position: relative;
display: inline-block;
box-sizing: border-box;
overflow: visible;
vertical-align: top;
font-style: normal;
height: 1em;
width: 1em;
mix-blend-mode: multiply;
cursor: pointer;
}
td i:before {
width: 0.75em;
height: 0.75em;
top: 0.125em;
left: 0.125em;
background-color: #000;
border-radius: 0 80% 0 80%;
transform: rotate(-45deg);
}
td i:after {
width: 0.5em;
height: 0.5em;
left: 0.25em;
top: 0.25em;
border: 0.125em solid;
border-radius: 100%;
background-color: transparent;
transform: scale(0.8);
}
tr td:last-child {
opacity: 0.05;
}
tr:hover td:last-child {
opacity: 1;
}
tr.hidden td:not(:last-child) {
opacity: 0.1;
}
@media (max-width: 801px) {
table {
overflow-x: auto;
padding-right: 20px;
}
td:not(:last-child) {
min-width: 110px;
}
}
.progress {
display: flex;
overflow: hidden;
background-color: #ddd;
border-radius: 1px;
font-size: 0.8em;
line-height: 1.6em;
}
.progress .bar {
display: flex;
flex-direction: column;
color: #000;
text-align: center;
white-space: nowrap;
font-weight: 400;
padding-right: 2px;
text-indent: 5px;
}
.progress.disabled .bar {
width: 100%;
opacity: 0.5;
}
[data-sort] {
cursor: ns-resize;
}
code {
background-color: #F8F8F8;
color: #202224;
padding: 0.2em 0.3em;
border-radius: 0.3em;
}
#metadata {
padding: 0;
list-style: none;
}
#metadata li {
font-style: italic;
}
#metadata li strong {
display: inline-block;
text-align: right;
padding-right: 5px;
font-style: normal;
}
#form-out {
background: #ffffdd;
padding: 50px 0 20px;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
}
textarea, input {
border-radius: 2px 2px 0 0;
border: 1px solid #ccc;
width: 100%;
padding: 4px;
font-family: monospace;
font-size: 12px;
background: #f8f8f8;
line-height: 16px;
display: block;
flex: 1;
}
textarea {
max-width: 100%;
min-width: 100%;
height: 300px;
min-height: 300px;
max-height: 300px;
resize: none;
width: auto;
margin-bottom: 5px;
}
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
border: 1px solid #007D9C !important;
}
#instructions {
font-size: 0.8em;
}
@media (min-width: 600px) {
.container {
margin: 0;
}
}
@media (min-width: 801px) {
#metadata li strong {
width: 180px;
}
.container {
margin: 0 auto;
}
}
</style>
</body>
</html>
<!--
https://beautifytools.com/html-minifier.php
https://www.digitalocean.com/community/tools/minify
https://www.toptal.com/developers/cssminifier
-->