-
Notifications
You must be signed in to change notification settings - Fork 4
/
squash-benchmark.js
1666 lines (1565 loc) · 49.6 KB
/
squash-benchmark.js
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
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(){
function decimalAdjust(type, value, exp) {
if (typeof exp === 'undefined' || +exp === 0) {
return Math[type](value);
}
value = +value;
exp = +exp;
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
return NaN;
}
value = value.toString().split('e');
value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));
value = value.toString().split('e');
return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
}
if (!Math.round10) {
Math.round10 = function(value, exp) {
return decimalAdjust('round', value, exp);
};
}
if (!Math.floor10) {
Math.floor10 = function(value, exp) {
return decimalAdjust('floor', value, exp);
};
}
if (!Math.ceil10) {
Math.ceil10 = function(value, exp) {
return decimalAdjust('ceil', value, exp);
};
}
if (!Array.prototype.forEach) {
Array.prototype.forEach = function (fn, scope) {
'use strict';
var i, len;
for (i = 0, len = this.length; i < len; ++i) {
if (i in this) {
fn.call(scope, this[i], i, this);
}
}
};
}
})();
$(function () {
$('.failure-popover').popover({
html: true,
content: function() {
var contents = '';
var failures = jQuery.parseJSON($(this).attr('data-failures'));
failures.forEach (function (e, i, a) {
var issue;
if (e.issue == 'OOM')
issue = '<abbr title="Out Of Memory">OOM</abbr>';
else
issue = '<a href="' + e.issue + '"><i class="fa fa-bug"></i></a>';
contents +=
'<tr>' +
'<td>' + e.plugin + '</td>' +
'<td>' + e.codec + '</td>' +
'<td>' + e.dataset + '</td>' +
'<td style="text-align: center">' + issue + '</td>' +
'</tr>';
});
return $("<table class='table table-striped'><thead><th>Plugin</th><th>Codec</th><th>Dataset</th><th>Issue</th></thead><tbody>" + contents + "</tdody></table>");
}
});
})
var datasets = [
{ id: 'alice29.txt',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'English text',
size: 152089 },
{ id: 'asyoulik.txt',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'Shakespeare',
size: 125179 },
{ id: 'cp.html',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'HTML source',
size: 24603 },
{ id: 'dickens',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Collected works of Charles Dickens',
size: 10192446 },
{ id: 'enwik8',
source: 'Large Text Compression Benchmark',
sourceUrl: 'http://www.mattmahoney.net/dc/textdata.html',
description: 'The first 10⁸ bytes of the English Wikipedia dump on Mar. 3, 2006',
size: 100000000 },
{ id: 'fields.c',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'C source',
size: 11150 },
{ id: 'fireworks.jpeg',
source: 'Snappy',
sourceUrl: 'https://github.com/google/snappy/tree/master/testdata',
description: 'A JPEG image',
size: 123093 },
{ id: 'geo.protodata',
source: 'Snappy',
sourceUrl: 'https://github.com/google/snappy/tree/master/testdata',
description: 'A set of Protocol Buffer data',
size: 118588 },
{ id: 'grammar.lsp',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'LISP source',
size: 3721 },
{ id: 'kennedy.xls',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'Excel Spreadsheet',
size: 1029744 },
{ id: 'lcet10.txt',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'Technical writing',
size: 426754 },
{ id: 'mozilla',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Tarred executables of Mozilla 1.0 (Tru64 UNIX edition)',
size: 51220480 },
{ id: 'mr',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Medical magnetic resonanse image',
size: 9970564 },
{ id: 'nci',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Chemical database of structures',
size: 33553445 },
{ id: 'ooffice',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'A dll from Open Office.org 1.01',
size: 6152192 },
{ id: 'osdb',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Sample database in MySQL format from Open Source Database Benchmark',
size: 10085684 },
{ id: 'paper-100k.pdf',
source: 'Snappy',
sourceUrl: 'https://github.com/google/snappy/tree/master/testdata',
description: 'A PDF',
size: 102400 },
{ id: 'plrabn12.txt',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'Poetry',
size: 481861 },
{ id: 'ptt5',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'CCITT test set',
size: 513216 },
{ id: 'reymont',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Text of the book Chłopi by Władysław Reymont',
size: 6627202 },
{ id: 'samba',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Tarred source code of Samba 2-2.3 ',
size: 21606400 },
{ id: 'sao',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'The SAO star catalog',
size: 7251944 },
{ id: 'sum',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'SPARC Executable',
size: 38240 },
{ id: 'urls.10K',
source: 'Snappy',
sourceUrl: 'https://github.com/google/snappy/tree/master/testdata',
description: 'List of 10000 URLs',
size: 702087 },
{ id: 'xargs.1',
source: 'Canterbury Corpus',
sourceUrl: 'http://corpus.canterbury.ac.nz/descriptions/#cantrbry',
description: 'GNU manual page',
size: 4227 },
{ id: 'webster',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'The 1913 Webster Unabridged Dictionary',
size: 41458703 },
{ id: 'xml',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'Collected XML files',
size: 5345280 },
{ id: 'x-ray',
source: 'Silesia Corpus',
sourceUrl: 'http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia',
description: 'X-ray medical picture',
size: 8474240 }
];
var dataset_map = {};
datasets.forEach (function (e, i, a) {
dataset_map[e.id] = e;
});
var machines = [
{ name: "peltast",
cpu: "Intel® Xeon® Processor E3-1225 v3",
cpuUrl: "http://ark.intel.com/products/75461/",
architecture: "x86_64",
speed: 3200 * 1000000,
memory: 1024 * 20,
platform: "Lenovo ThinkServer TS140",
platformUrl: "http://shop.lenovo.com/us/en/servers/thinkserver/ts-series/ts140/",
distro: "Fedora 24",
kernel: "4.5.5",
compiler: "clang-3.8.0" },
{ name: "hoplite",
cpu: "Intel® Core™ i7-2630QM",
cpuUrl: "http://ark.intel.com/products/52219",
architecture: "x86_64",
speed: 2000 * 1000000,
memory: 1024 * 6,
platform: "Toshiba Satellite A660-X",
platformUrl: "http://support.toshiba.com/support/modelHome?freeText=PSAW6U-02100C",
distro: "Fedora 22",
kernel: "4.1.4",
compiler: "gcc-5.1.1" },
{ name: "phalanx",
cpu: "Intel® Atom™ D525",
cpuUrl: "http://ark.intel.com/products/49490",
architecture: "x86_64",
speed: 1800 * 1000000,
memory: 1024 * 4,
platform: "Asus AT5NM10T-I",
platformUrl: "http://www.asus.com/Motherboards/AT5NM10TI/",
distro: "Fedora 22",
kernel: "4.1.4",
compiler: "gcc-5.1.1" },
{ name: "s-desktop",
cpu: "Intel® Core™ i5-2400",
cpuUrl: "http://ark.intel.com/products/52207",
architecture: "x86_64",
speed: 3100 * 1000000,
memory: 1024 * 4,
platform: "Asus P8Z68-V",
platformUrl: "http://www.asus.com/Motherboards/P8Z68V/",
distro: "Fedora 22",
kernel: "4.1.4",
compiler: "gcc-5.1.1" },
{ name: "e-desktop",
cpu: "Intel® Core™ i3-2105",
cpuUrl: "http://ark.intel.com/products/55448",
architecture: "x86_64",
speed: 3100 * 1000000,
memory: 1024 * 8,
platform: "Asus P8H61-H",
platformUrl: "http://www.asus.com/Motherboards/P8H61M/",
distro: "Fedora 22",
kernel: "4.1.4",
compiler: "gcc-5.1.1" },
// { name: "raspberry-pi-bplus",
// cpu: "Broadcom BCM2835",
// cpuUrl: "http://www.broadcom.com/products/BCM2835",
// architecture: "armv6l",
// speed: 700 * 1000000,
// memory: 512,
// platform: "Raspberry Pi Model B+",
// platformUrl: "http://www.raspberrypi.org/products/model-b-plus/",
// distro: "Raspbian",
// kernel: "" },
{ name: "raspberry-pi-2",
cpu: "Broadcom BCM2709",
cpuUrl: "http://www.broadcom.com/products/BCM2709",
architecture: "armv7l",
speed: 900 * 1000000,
memory: 1024,
platform: "Raspberry Pi 2 Model B",
platformUrl: "http://www.raspberrypi.org/products/raspberry-pi-2-model-b/",
distro: "Raspbian Jessie",
kernel: "4.1.6",
compiler: "gcc-4.9.2" },
// { name: "pandaboard-es",
// cpu: "Texas Instruments OMAP4460",
// cpuUrl: "http://www.ti.com/product/omap4460",
// architecture: "armv7l",
// speed: 1200 * 1000000,
// memory: 1024,
// platform: "PandaBoard ES revision B1",
// platformUrl: "http://pandaboard.org/node/300/#PandaES",
// distro: "Ubuntu 14.10",
// kernel: "3.18.3" },
{ name: "beagleboard-xm",
cpu: "Texas Instruments DM3730",
cpuUrl: "http://www.ti.com/product/dm3730",
architecture: "armv7l",
speed: 1000 * 1000000,
memory: 512,
platform: "BeagleBoard-xM revision B",
platformUrl: "http://beagleboard.org/beagleboard-xm",
distro: "Ubuntu 15.04",
kernel: "4.1.5",
compiler: "gcc-4.9.2" },
{ name: "odroid-c1",
cpu: "Amlogic S805",
cpuUrl: "http://www.amlogic.com/product03.htm",
architecture: "armv7l",
speed: 1500 * 1000000,
memory: 1024,
platform: "ODROID-C1",
platformUrl: "http://www.hardkernel.com/main/products/prdt_info.php?g_code=G141578608433",
distro: "Ubuntu 14.04.4",
kernel: "3.10.80",
compiler: "gcc-4.9.2" },
// { name: "igepv5",
// cpu: "Texas Instruments OMAP5432",
// cpuUrl: "http://www.ti.com/product/omap5432",
// architecture: "armv7l",
// speed: 1500 * 1000000,
// memory: 4096,
// platform: "ISEE IGEPv5",
// platformUrl: "https://isee.biz/products/igep-processor-boards/igepv5-omap5432",
// distro: "Ubuntu",
// kernel: "" },
{ name: "satellite-a205",
cpu: "Intel® Celeron® Processor 540",
cpuUrl: "http://ark.intel.com/products/30774/Intel-Celeron-Processor-540-1M-Cache-1_86-GHz-533-MHz-FSB",
architecture: "x86_64",
speed: 1860 * 1000000,
memory: 1024,
platform: "Toshiba Satellite A205-S5805",
platformUrl: "http://support.toshiba.com/support/modelHome?freeText=1909175",
distro: "Fedora 21",
kernel: "4.1.6",
compiler: "gcc-4.9.2" },
];
var machine_map = {};
machines.forEach (function (e, i, a) {
machine_map[e.name] = e;
});
var plugins = [
{ id: "brieflz",
name: "BriefLZ",
libraryUrl: "https://github.com/jibsen/brieflz",
license: "MIT",
revision: "bcaa6a1ee7ccf005512b5c23aa92b40cf75f9ed1",
codecs: [ { name: "brieflz" } ], },
{ id: "brotli",
name: "Brotli",
libraryUrl: "https://github.com/google/brotli",
license: "Apache 2.0",
revision: "1dd66ef114fd244778d9dcb5da09c28b49a0df33",
codecs: [ { name: "brotli",
levels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
streaming: true } ], },
{ id: "bsc",
name: "bsc",
libraryUrl: "http://libbsc.com/",
license: "Apache 2.0",
revision: "b2b07421381b19b2fada8b291f3cdead10578abc",
codecs: [ { name: "bsc" } ] },
{ id: "bzip2",
name: "bzip2",
libraryUrl: "http://bzip.org/",
license: "zlib & 3-clause BSD hybrid",
version: "1.0.6",
codecs: [
{ name: "bzip2",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true } ] },
{ id: "copy",
name: "Copy",
codecs: [
{ name: "copy",
streaming: true,
flushing: true } ]},
{ id: "crush",
name: "CRUSH",
libraryUrl: "http://compressme.net/",
license: "Public Domain",
version: "1.0",
codecs: [
{ name: "crush",
levels: [0, 1, 2] } ],
streaming: true },
// { id: "csc",
// name: "CSC",
// libraryUrl: "https://github.com/fusiyuan2010/CSC",
// license: "MIT",
// revision: "c8f1580bd765c8e77d6cffb6bf900bf70e31aa0c",
// codecs: [ { name: "csc",
// levels: [1, 2, 3, 4, 5],
// streaming: true } ] },
// { id: "density",
// name: "DENSITY",
// libraryUrl: "https://github.com/centaurean/density",
// license: "3-clause BSD",
// revesion: "b252a3260cd7a727b0f7b69d1bf3b82e1da7d89a",
// codecs: [
// { name: "density",
// levels: [1, 7, 9] } ],
// streaming: true },
// { id: "doboz",
// name: "Doboz",
// libraryUrl: "https://bitbucket.org/attila_afra/doboz",
// codecs: [ { name: "doboz" } ] },
{ id: "fari",
name: "FastARI",
libraryUrl: "https://github.com/davidcatt/FastARI",
license: "MIT",
revision: "19845efa6294c8af4f9d5bd1d3e46dfbd0c0c1c5",
codecs: [ { name: "fari" } ] },
{ id: "fastlz",
name: "FastLZ",
libraryUrl: "http://fastlz.org/",
license: "MIT",
revision: "12",
codecs: [
{ name: "fastlz",
levels: [1, 2] } ] },
{ id: "gipfeli",
name: "Gipfeli",
libraryUrl: "https://github.com/google/gipfeli",
license: "3-clause BSD",
revision: "65b9721308a357f6aa261c11d0af291d10d0b96c",
codecs: [ { name: "gipfeli" } ] },
{ id: "heatshrink",
name: "Heatshrink",
libraryUrl: "https://github.com/atomicobject/heatshrink",
license: "MIT",
revision: "7d419e1fa4830d0b919b9b6a91fe2fb786cf3280",
codecs: [ { name: "heatshrink" } ] },
{ id: "libdeflate",
name: "libdeflate",
libraryUrl: "https://github.com/ebiggers/libdeflate/",
license: "CC0",
revision: "f649a4b8db1df8b0e26242e92361376d4a729f42",
codecs: [ { name: "deflate",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]} ] },
{ id: "lz4",
name: "LZ4",
libraryUrl: "https://cyan4973.github.io/lz4/",
license: "3-clause BSD",
revision: "d86dc916771c126afb797637dda9f6421c0cb998",
codecs: [
{ name: "lz4",
levels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] },
{ name: "lz4-raw",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] } ],
streaming: true,
flushing: true },
{ id: "lzf",
name: "liblzf",
libraryUrl: "http://oldhome.schmorp.de/marc/liblzf.html",
license: "2-clause BSD or GPLv2+",
version: "3.8",
codecs: [ { name: "lzf" } ] },
{ id: "lzfse",
name: "lzfse",
libraryUrl: "https://github.com/lzfse/lzfse",
license: "3-clause BSD",
revision: "9014692a0fcccef119f8f2fd50e19428dac01d99",
codecs: [
{ name: "lzfse" },
{ name: "lzvn" }
] },
{ id: "lzg",
name: "liblzg",
libraryUrl: "http://liblzg.bitsnbites.eu/",
license: "zlib",
version: "1.0.8",
codecs: [
{ name: "lzg",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9] } ] },
{ id: "lzham",
name: "LZHAM",
libraryUrl: "https://github.com/richgel999/lzham_codec/",
license: "MIT",
revision: "fb1a9b0a28d5194ad6a643ed89d704a6ffe1d91a",
codecs: [
{ name: "lzham",
levels: [0, 1, 2, 3, 4],
streaming: true,
flushing: true } ] },
{ id: "lzjb",
name: "LZJB",
libraryUrl: "https://en.wikipedia.org/wiki/LZJB",
license: "CDDL",
codecs: [ { name: "lzjb" } ] },
{ id: "lzma",
name: "XZ Utils",
libraryUrl: "http://tukaani.org/xz/",
license: "Public Domain",
version: "5.2.1",
codecs: [
{ name: "lzma",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true },
{ name: "lzma1",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true },
{ name: "lzma2",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
{ name: "xz",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9] } ],
streaming: true,
flushing: true },
{ id: "lzo",
name: "LZO",
libraryUrl: "http://www.oberhumer.com/opensource/lzo/",
license: "GPLv2+",
version: "2.09",
codecs: [
// { name: "lzo1",
// levels: [1, 99] },
// { name: "lzo1a",
// levels: [1, 99] },
{ name: "lzo1b",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 999] },
{ name: "lzo1c",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 999] },
{ name: "lzo1f",
levels: [1, 999] },
{ name: "lzo1x",
levels: [1, 11, 12, 15, 999] },
{ name: "lzo1y",
levels: [1, 999] },
{ name: "lzo1z",
levels: [999] } ] },
{ id: "miniz",
name: "MiniZ",
libraryUrl: "https://github.com/richgel999/miniz",
license: "Public Domain",
revision: "28f5066e332590c8a68fa4870e89233e72ce7a44",
codecs: [ { name: 'zlib' } ] },
{ id: "ms-compress",
name: "ms-compress",
libraryUrl: "https://github.com/coderforlife/ms-compress/",
license: "GPLv3+",
revision: "8ba2fb09499c0623d78997f11db6b3062d99785c",
codecs: [
{ name: "lznt1",
streaming: true,
flushing: true },
{ name: "xpress" },
{ name: "xpress-huffman" },
] },
{ id: "ncompress",
name: "ncompress",
libraryUrl: "http://ncompress.sourceforge.net/",
license: "Public Domain",
version: "4.2.4.4",
codecs: [
{ name: 'compress' }
] },
// { id: "pithy",
// name: "Pithy",
// libraryUrl: "https://github.com/johnezang/pithy",
// license: "3-clause BSD",
// revision: "d7d5bd3a20f97d46454f9e651ec6b3dd5801885e",
// codecs: [
// { name: "pithy",
// levels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]},
// ] },
{ id: "quicklz",
name: "QuickLZ",
libraryUrl: "http://www.quicklz.com/",
license: "GPL v1, v2, or v3",
version: "1.5.0",
codecs: [ { name: "quicklz" } ] },
{ id: "snappy",
name: "Snappy",
libraryUrl: "https://google.github.io/snappy/",
license: "3-clause BSD",
revision: "0852af76065ba0f35944527e14787f7ae5e0b3ac",
codecs: [
{ name: "snappy" },
// { name: "snappy-framed",
// streaming: true,
// flushing: true }
] },
{ id: "wflz",
name: "wfLZ",
libraryUrl: "https://github.com/ShaneWF/wflz",
revision: "cfbb02d7a87ab3e39c6a4394da2281744a671ed2",
codecs: [
{ name: "wflz",
levels: [1, 2] },
{ name: "wflz-chunked",
levels: [1, 2] },
] },
{ id: "yalz77",
name: "yalz77",
libraryUrl: "https://bitbucket.org/tkatchev/yalz77",
revision: "36429ac62e9991b5d52fc37d326d50b6e59a895a",
codecs: [
{ name: "yalz77" },
] },
{ id: "zlib",
name: "zlib",
libraryUrl: "http://zlib.net/",
license: "zlib",
version: "1.2.8",
codecs: [
{ name: "deflate",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
{ name: "gzip",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
{ name: "zlib",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
] },
{ id: "zlib-ng",
name: "zlib-ng",
libraryUrl: "https://github.com/Dead2/zlib-ng/",
license: "zlib",
revision: "c81cad987823f5f0bbb9aabda387ca94066e4ab9",
codecs: [
{ name: "deflate",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
{ name: "gzip",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
{ name: "zlib",
levels: [1, 2, 3, 4, 5, 6, 7, 8, 9],
streaming: true,
flushing: true },
] },
{ id: "zling",
name: "libzling",
libraryUrl: "https://github.com/richox/libzling",
revision: "07a80c767d32a26c72336c635573c531cc3dd6d6",
codecs: [
{ name: "zling",
levels: [0, 1, 2, 3, 4] },
] },
{ id: "zpaq",
name: "ZPAQ",
libraryUrl: "http://mattmahoney.net/dc/zpaq.html",
license: "Public Domain",
version: "7.05",
codecs: [
{ name: "zpaq",
levels: [1, 2, 3, 4, 5],
streaming: true },
] },
{ id: "zstd",
name: "Zstandard",
libraryUrl: "https://github.com/Cyan4973/zstd",
license: "2-clause BSD",
revision: "9c57b424d6f24629de7c7249e4e847900846887b",
codecs: [
{ name: "zstd",
levels: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ] },
] }
];
var plugins_map = {};
plugins.forEach (function (e, i, a) {
plugins_map[e.id] = e;
});
function formatSize(size, precision) {
if (precision == undefined)
precision = -2;
if (size < 1024) {
return size + " B";
} else if (size < (1024 * 1024)) {
return Math.round10(size / 1024, precision) + " KiB";
} else if (size < (1024 * 1024 * 1024)) {
return Math.round10(size / (1024 * 1024), precision) + " MiB";
} else if (size < (1024 * 1024 * 1024 * 1024)) {
return Math.round10(size / (1024 * 1024 * 1024), precision) + " GiB";
} else {
return Math.round10(size / (1024 * 1024 * 1024 * 1024), precision) + " TiB";
}
}
function formatSpeed(speed, precision) {
return formatSize(speed, precision) + "/s";
}
function formatFrequency(size, precision) {
if (precision == undefined)
precision = -2;
if (size < 1000) {
return size + " Hz";
} else if (size < 1000000) {
return Math.round10(size / 1000, precision) + " KHz";
} else if (size < 1000000000) {
return Math.round10(size / 1000000, precision) + " MHz";
} else if (size < 1000000000000) {
return Math.round10(size / 1000000000, precision) + " GHz";
} else {
return Math.round10(size / 1000000000000, precision) + " THz";
}
}
function formatDuration(seconds) {
var res = "";
var w = false;
function zeroPad (n, width, z) {
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z || '0') + n;
}
[60*60*24, 60*60, 60, 1].forEach (function (d) {
if ((seconds >= d) || w) {
x = Math.floor (seconds / d);
seconds -= d * x;
res += (w ? ':' : '') + zeroPad (x, 2);
w = true;
}
});
if (res == '') {
if (seconds == 0)
return '0';
var remaining = seconds;
res = '0.';
while (remaining < 0.1) {
res += '0';
remaining *= 10;
}
res += Math.round10(remaining * 1000);
}
return res;
}
var squashBenchmarkApp = angular.module("squashBenchmark", []);
squashBenchmarkApp.factory('squashBenchmarkData', function($q) {
return function(machineId) {
return $q(function (resolve, reject) {
d3.csv ("data/" + machineId + ".csv", function(data) {
resolve(data.map (function (val) {
var input_size = dataset_map[val.dataset].size;
return {
dataset: val.dataset,
plugin: val.plugin,
codec: val.codec,
level: val.level,
input_size: input_size,
compressed_size: parseInt(val.compressed_size),
compressed_size: parseInt(val.compressed_size),
compress_cpu: parseFloat(val.compress_cpu),
compress_wall: parseFloat(val.compress_wall),
decompress_cpu: parseFloat(val.decompress_cpu),
decompress_wall: parseFloat(val.decompress_wall),
ratio: input_size / val.compressed_size,
compression_rate: input_size / val.compress_cpu,
decompression_rate: input_size / val.decompress_cpu
};
}));
});
});
};
});
squashBenchmarkApp.filter('formatSpeed', function() {
return function(input, precision) {
return formatSpeed(input, precision);
};
})
squashBenchmarkApp.filter('formatSize', function() {
return function(input, precision) {
return formatSize(input, precision);
};
})
squashBenchmarkApp.filter('formatFrequency', function() {
return function(input, precision) {
return formatFrequency(input, precision);
};
})
squashBenchmarkApp.filter('formatDuration', function() {
return function(input) {
return formatDuration(input);
};
})
squashBenchmarkApp.controller("SquashBenchmarkCtrl", function ($scope, squashBenchmarkData) {
$scope.datasets = datasets;
$scope.machines = machines;
$scope.plugins = plugins;
$scope.location = window.location.href.split ("?")[0];
$scope.query_string = function () {
// http://stackoverflow.com/a/979995
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
} ();
$scope.random_dataset = true;
if ($scope.query_string.dataset != undefined && dataset_map[$scope.query_string.dataset] != undefined) {
$scope.dataset = $scope.query_string.dataset;
$scope.random_dataset = false;
} else {
do {
$scope.dataset = datasets[Math.floor (Math.random () * datasets.length)].id;
} while ($scope.dataset == "fireworks.jpeg");
}
$scope.random_machine = true;
if ($scope.query_string.machine != undefined && machine_map[$scope.query_string.machine] != undefined) {
$scope.machine = $scope.query_string.machine;
$scope.random_machine = false;
} else {
$scope.machine = machines[Math.floor (Math.random () * machines.length)].name;
}
$scope.datasetSort = 'id';
$scope.machineSort = 'name';
$scope.rawSort = 'plugin';
$scope.data_points_per_machine = 0;
$scope.codec_plugin_map = {};
$scope.codecs = [];
plugins.forEach (function (plugin, i, a) {
plugin.codecs.forEach (function (codec, ci, ca) {
$scope.codecs.push (codec);
$scope.codec_plugin_map[plugin.id + ":" + codec.id];
$scope.data_points_per_machine += (codec.levels == undefined) ? 1 : codec.levels.length;
});
});
$scope.speedScale = "linear";
if ($scope.query_string["speed-scale"] != undefined) {
$scope.speedScale = ($scope.query_string["speed-scale"] == "logarithmic") ? "logarithmic" : "linear";
}
$scope.transferProcessVisible = 125;
if ($scope.query_string.speed != undefined) {
$scope.transferSpeedUnits = "KiB/s";
var speed = parseInt ($scope.query_string.speed);
if (speed > 1024 && (speed % 256 == 0)) {
speed /= 1024;
$scope.transferSpeedUnits = "MiB/s";
if (speed > 1024 && (speed % 256 == 0)) {
speed /= 1024;
$scope.transferSpeedUnits = "GiB/s";
if (speed > 1024 && (speed % 256 == 0)) {
speed /= 1024;
$scope.transferSpeedUnits = "TiB/s";
}
}
}
$scope.transferSpeed = speed;
} else {
$scope.transferSpeedUnits = "MiB/s";
$scope.transferSpeed = 125;
}
if ($scope.query_string["hidden-plugins"] != undefined) {
var hidden_plugins = $scope.query_string["hidden-plugins"].toLowerCase ().split (",");
plugins.forEach (function (plugin) {
plugin.visible = hidden_plugins.indexOf (plugin.id) == -1;
});
} else if ($scope.query_string["visible-plugins"] != undefined) {
var visible_plugins = $scope.query_string["visible-plugins"].toLowerCase ().split (",");
plugins.forEach (function (plugin) {
plugin.visible = visible_plugins.indexOf (plugin.id) != -1;
});
} else {
plugins.forEach (function (plugin) {
plugin.visible = true;
});
}
$scope.$watchGroup (['transferSpeed', 'transferSpeedUnits'], function (newData, oldData, scope) {
scope.calculatedTransferSpeed = scope.transferSpeed;
switch (scope.transferSpeedUnits) {
case "KiB/s":
scope.calculatedTransferSpeed = scope.calculatedTransferSpeed * 1024;
break;
case "MiB/s":
scope.calculatedTransferSpeed = scope.calculatedTransferSpeed * (1024 * 1024);
break;
case "GiB/s":
scope.calculatedTransferSpeed = scope.calculatedTransferSpeed * (1024 * 1024 * 1024);
break;
}
});
$scope.transferProcessSort = "time";
$scope.transferProcessDirection = "decompress";
var colors = d3.scale.category20().range()
.concat (d3.scale.category20b().range(),
d3.scale.category20c().range());
var chartData = [];
function drawRatioCompressionChart (xAxis, yAxis) {
if (xAxis == undefined)
xAxis = $scope.speedScale;
if (yAxis == undefined)
yAxis = 'linear';
var chart = $("#ratio-compression-chart").highcharts({
chart: { type: 'scatter' },
title: { text: null },
xAxis: {
title: {
enabled: true,
text: 'Compression Speed'
},
startOnTick: true,
endOnTick: true,
min: (xAxis == 'logarithmic') ? undefined : 0,
labels: {
rotation: -45,
formatter: function() { return formatSpeed(this.value); }
},
type: xAxis
},
yAxis: {
title: {
text: 'Ratio'
},
type: yAxis
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top'
},
plotOptions: {
scatter: {
tooltip: {
headerFormat: '<b>{series.name}</b>',
pointFormatter: function () {
res = ":<b>" + this.codec + "</b><hr/><br/>";
if (this.level != "")
res += "Level: " + this.level + "<br/>";
res += "Ratio: " + Math.round10(this.y, -2) + "<br/>";
res += "Compression speed: " + formatSpeed(this.x) + "<br/>";
res += "Decompression speed: " + formatSpeed(this.z) + "<br/>";
return res;
}
}
}
},
series: chartData.map(function (e, i, a) {
return {
visible: (plugins_map[e.plugin] == undefined) ? false : plugins_map[e.plugin].visible,
name: e.plugin,