-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
902 lines (902 loc) · 61.2 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
<link rel="stylesheet"
href="https://unpkg.com/bootstrap-material-design@4.1.1/dist/css/bootstrap-material-design.min.css"
integrity="sha384-wXznGJNEXNG1NFsbm0ugrLFMQPWswR3lds2VeinahP8N0zJw9VWSopbjv2x7WCvX"
crossorigin="anonymous">
<title>lossless-benchmark</title>
<style>
div#programs_series > ul > li > h5 {
font-weight: 700;
}
</style>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div class="container" style="max-width: 95%;">
<a href="https://github.com/tarsa/lossless-benchmark"><h1>Lossless data compression benchmark</h1></a>
<div>
Contents:
<ul id="links">
<li><a href="#results">Results</a></li>
<li><a href="#algorithms">Algorithms</a></li>
<li><a href="#testsets">Test sets</a></li>
<li><a href="#programs_series">Compression programs</a></li>
<li><a href="#rules">Rules</a></li>
<li><a href="#faq">Questions & answers</a></li>
</ul>
</div>
<br/>
<h3 id="results_title" class="text-center">[filled in script]</h3>
<form class="row justify-content-center">
<div class="radio col">
<label>
<input type="radio" name="plot_mode" value="plot_sizes">
Plot sizes
</label>
</div>
<div class="radio col">
<label>
<input type="radio" name="plot_mode" value="plot_percentages">
Plot percentages
</label>
</div>
<div class="radio col">
<label>
<input type="radio" name="plot_mode" value="plot_ratios" checked>
Plot ratios
</label>
</div>
</form>
<div id="results_plot"></div>
<nav id="results" data-selected_corpus_id="enwik">
<div class="nav nav-tabs nav-fill" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-enwik-results-tab" href="#nav-enwik-results" role="tab"
data-toggle="tab" aria-controls="nav-enwik-results" aria-selected="true">enwik8 & enwik9</a>
</div>
</nav>
<div class="tab-content" id="nav-tab-content">
<div class="tab-pane show active" id="nav-enwik-results" role="tabpanel"
aria-labelledby="nav-enwik-results-tab" data-field_name="total_compressed_size">
<form>
<div class="row">
<div class="col form-group">
<label for="enwik_shown_series">Show compressor series</label>
<select multiple class="form-control" id="enwik_shown_series" style="height: 100%;">
<!-- filled in script -->
</select>
</div>
<div class="col form-group">
<label for="enwik_collapsed_series">Show only best non-outdated result in series</label>
<select multiple class="form-control" id="enwik_collapsed_series">
<!-- filled in script -->
</select>
<div class="row">
<button type="button" class="btn btn-secondary col-6"
id="enwik_select_all_collapsed">Select all</button>
<button type="button" class="btn btn-secondary col-6"
id="enwik_select_none_collapsed">Deselect all</button>
</div>
</div>
<div class="col form-group">
<label for="enwik_outdated_series">Show outdated results</label>
<select multiple class="form-control" id="enwik_outdated_series">
<!-- filled in script -->
</select>
<div class="row">
<button type="button" class="btn btn-secondary col-6"
id="enwik_select_all_outdated">Select all</button>
<button type="button" class="btn btn-secondary col-6"
id="enwik_select_none_outdated">Deselect all</button>
</div>
</div>
</div>
<div class="row">
<a id="enwik_download" class="btn btn-outline-success col-sm-1" role="button"
download="results_enwik.csv">
Export CSV
</a>
<label for="enwik_results_dump" class="col-sm-2 col-form-label">Raw JSON dump:</label>
<div class="col-sm-9">
<input type="text" readonly class="form-control-plaintext" id="enwik_results_dump">
</div>
</div>
</form>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th class="border-bottom-0 pb-0 text-left">#</th>
<th class="border-bottom-0 pb-0 text-left">Program series</th>
<th class="border-bottom-0 pb-0 text-left">Program name</th>
<th class="border-bottom-0 pb-0 text-left">Options</th>
<th class="border-bottom-0 pb-0 text-center" colspan="2">Compressed size</th>
<th class="border-bottom-0 pb-0 text-right">Decompressor size (7z or Zip)</th>
<th class="border-bottom-0 pb-0 text-right" style="font-size: 1.25rem;">Total size</th>
<th class="border-bottom-0 pb-0 text-center" colspan="2">Time (ns/byte)</th>
<th class="border-bottom-0 pb-0 text-center">Mem</th>
<th class="border-bottom-0 pb-0 text-left">
<a href="#algorithms" class="text-white">Alg</a>
</th>
<th class="border-bottom-0 pb-0 text-right">Note</th>
</tr>
<tr>
<th class="border-top-0 pt-0" colspan="4"></th>
<th class="border-top-0 pt-0 text-right" id="enwik8_size_column">enwik8</th>
<th class="border-top-0 pt-0 text-right" id="enwik9_size_column">enwik9</th>
<th class="border-top-0 pt-0"></th>
<th class="border-top-0 pt-0 text-right" id="enwik_total_size_column">enwik9 + prog</th>
<th class="border-top-0 pt-0 text-right">Comp</th>
<th class="border-top-0 pt-0 text-right">Decomp</th>
<th class="border-top-0 pt-0 text-center">
<select id="memory_scale_selector" style="padding: 0rem 1rem;">
<option value="1">bytes</option>
<option value="1000">kB</option>
<option value="1024">KiB</option>
<option value="1000000" selected>MB</option>
<option value="1048576">MiB</option>
</select>
</th>
<th class="border-top-0 pt-0" colspan="2"></th>
</tr>
</thead>
<tbody id="enwik_results_body"><!-- filled in script --></tbody>
</table>
<div id="notes">
<h3>Notes</h3>
<ol>
<li id="note-1">
Reported by Darek on May 9, 2018. System: Core i7 4900MQ at 3.8GHz, 32GB, Win7Pro 64.
</li>
<li id="note-2">
Reported by Byron Knoll. System: Core i7 7700K at 4.7GHz, 32GB, Ubuntu 16.04.
</li>
<li id="note-3">
Reported by Byron Knoll. System: Core i7 3770 at 3.5GHz, 32GB, Linux Mint 14.
</li>
</ol>
</div>
</div>
</div>
<br/>
<div id="algorithms">
<h3>Algorithms</h3>
Column "Alg" shows the dominant algorithm used in a compression program. Compression algorithms are
explained in depth in an excellent online book
<a href="http://mattmahoney.net/dc/dce.html">Data Compression Explained</a> so I won't repeat that
here. I will only list some algorithms names and their abbreviations:
<ul>
<li>CM = Context Mixing</li>
<li>BWT = Burrows-Wheeler Transform</li>
<li>LZ = Lempel-Ziv compressors family</li>
<li>LZ77 = Lempel-Ziv variant 1, published in 1977</li>
<li>LZ78 = Lempel-Ziv variant 2, published in 1978</li>
<li>LZP = Lempel-Ziv Predictive</li>
<li>LZW = Lemper-Ziv-Welch</li>
<li>o<N> = order-N coding</li>
<li>PPM = Prediction by Partial Matching</li>
<li>ROLZ = Reduced Offset LZ</li>
</ul>
Please note that compression programs often combine multiple compression algorithms, filtering,
transforms, etc so the dominant algorithm (or algorithms) is a subjective category and can also be a
subject to interpretation and/ or discussion. Some algorithm families (like Lempel-Ziv) have multiple
variants so concrete algorithm can be either named after the popular algorithm family it resembles or
named with it's unique name.
</div>
<br/>
<div id="testsets">
<h3>Test sets:</h3>
<ul>
<li id="testset_enwik">
<a href="http://mattmahoney.net/dc/textdata.html">enwik8 & enwik9</a> are the test files
used in <a href="http://mattmahoney.net/dc/text.html">Large Text Compression Benchmark</a>
created by <a href="http://mattmahoney.net/">Matt Mahoney</a>.
</li>
<li id="testset_calgary">
<a href="https://en.wikipedia.org/wiki/Calgary_corpus">Calgary corpus</a> is a set of test files
created by Ian Witten, Tim Bell and John Cleary from University of Calgary and is currently
avaiable <a href="http://corpus.canterbury.ac.nz/descriptions/#calgary">here</a>.
</li>
<li id="testset_canterbury">
<a href="https://en.wikipedia.org/wiki/Canterbury_corpus">Canterbury corpus</a> is a set of test
files created at University of Canterbury and is currently available
<a href="http://corpus.canterbury.ac.nz/">here</a>.
</li>
<li id="testset_max_comp">
<a href="https://www.maximumcompression.com/">Maximum Compression</a> is a lossless data
compression benchmark created by Werner Bergman. It has two benchmark modes - single file
compression (SFC) and multiple files compression (MFC). In SFC files are compressed
independently and only compression ratio is tracked. In MFC files are compressed all at once and
additionally compression and decompression times are published and analyzed. Only files for SFC
are public and are available
<a href="https://www.maximumcompression.com/data/files/index.html">here</a>.
</li>
<li id="testset_silesia">
<a href="http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia">Silesia compression corpus</a>
was developed by Sebastian Deorowicz et al. It is a much newer corpus than Calgary corpus or
Canterbury corpus and aims to reflect data types in common use when creating the corpus.
</li>
</ul>
</div>
<br/>
<div id="programs_series">
<h3>Compression programs</h3>
<ul>
<li id="bzip_series">
<h5>bzip</h5>
<p>
<a href="http://www.bzip.org/">bzip2</a> is a single file compressor with BSD-like license
by Julian Seward. It popularized Burrows-Wheeler Transform as a means for compression. Its
predecessor, bzip, was encumbered by patents due to use of arithmetic coding. bzip2 uses
Huffman coding instead.
</p>
</li>
<li id="cmix_series">
<h5>cmix</h5>
<p>
<a href="http://www.byronknoll.com/cmix.html">cmix</a> is GPL-licensed file compressor by
Byron Knoll. Is is based on PAQ series of compression programs, but greatly increases amount
of processing per input bit. Recent versions include
<a href="https://en.wikipedia.org/wiki/Long_short-term_memory">LSTM neural networks</a>
based models.
</p>
</li>
<li id="CMV_series">
<h5>CMV</h5>
<p>
<a href="http://encode.ru/threads/2284-CMV">CMV</a> is free, closed source file compressor
by Mauro Vezzosi.
</p>
</li>
<li id="COPY_series">
<h5>COPY</h5>
<p>
This is actually a no operation. Exists to show uncompressed file sizes.
</p>
</li>
<li id="Info-ZIP_series">
<h5>Info-ZIP</h5>
<p>
<a href="http://www.info-zip.org/">Info-ZIP</a> is a collection of portable software for
handling of .zip archives. It has BSD-like license.
</p>
</li>
<li id="PAQ_series">
<h5>PAQ</h5>
<p>
<a href="http://mattmahoney.net/dc/paq.html">PAQ</a> is a series of GPL-licensed context
mixing file archivers originally developed by Matt Mahoney and also improved by numerous
contributors.
</p>
</li>
</ul>
</div>
<br/>
<div id="rules">
<h3>Rules:</h3>
<ul>
<li>
Results must be publicly verifiable. Compression programs must be free for personal use without
expiration date (no trialware) and without registration. Publishing benchmark results must not
be prohibited in program license.
</li>
<li>
By default programs are ranked by compressed (enwik9 or all files) size + decompressor size.
Decompressor size may be based on publicly available source code (if it exists) or executable
size. Decompressor itself may be compressed to .7z format using LZMA compression or to .zip
format using Deflate compression. Source form is denoted by placing <code>(s)</code> after
decompressor size, executable form is denoted by placing <code>(x)</code>.
</li>
<li>
Decompressor must be self-contained. It must not rely on any data that is not contained in
decompressor package. Any libraries that are not standard libraries or are not available in
stock OS install must also be placed in decompressor package (in source or executable form).
</li>
</ul>
</div>
<br/>
<div id="faq">
<h3>Questions & answers</h3>
<ol>
<li>
<p><b>Q: How to measure speed and memory usage on Microsoft Windows?</b></p>
<p>A: Look for latest version of ProcProfile here:
<a href="https://encode.ru/threads/1838-Command-Line-Process-Profiling-Tool">encode.ru:
Command Line Process Profiling Tool</a></p>
</li>
<li>
<p><b>Q: How to measure speed and memory usage on GNU/ Linux?</b></p>
<p>A: Invoke <code>/usr/bin/time -v <original command></code>. Time to be reported will
be after <code>Elapsed (wall clock) time</code> and memory usage to be reported will be
after <code>Maximum resident set size (kbytes)</code> (needs to be scaled to get usage in
megabytes).</p>
</li>
</ol>
</div>
</div>
<div class="modal" id="info_modal" tabindex="-1" role="dialog"
aria-labelledby="info_modal_title" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="info_modal_title">Modal title (to be filled in script)</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="info_modal_content">
Modal content (to be filled in script)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.8.9/jquery.csv.min.js"
integrity="sha256-F8eQhL9KDGgaDitxiSyq6SnTCL0m67rt7niivBtH2rc="
crossorigin="anonymous"></script>
<script>
"use strict";
// scripts are split to work around NetBeans parsing problems
</script>
<script>
// input data: enwiks
let enwik_results_csv = String.raw`
program_series,program_name,program_options,compressed_enwik8_size,compressed_enwik9_size,decompressor_size,total_compressed_size,compression_time,decompression_time,memory_usage_in_bytes,algorithm_type,note_id,outdated
COPY,original files,,100000000,1000000000,0,1000000000,0,0,0,COPY,,no
CMV,CMV v00.01.01,"-m2,3,0x03ed7dfb",18122372,149357765,"78,922 (x)",149436687,426163,394855,3497000960,CM,1,no
PAQ,Paq8pxd_v47_3,resplit | paq -s15,16038418,126749584,"150,210 (s)",126899794,83435,86671,28940697600,CM,1,yes
PAQ,Paq8pxd_v48_bwt1,resplit | paq -s14,16004759,126183029,"153,295 (s)",126336324,579895,0,54384394240,CM,1,no
cmix,cmix v1,,16076381,128647538,"279,185 (x)",128926723,181924,179706,21283840000,CM,3,yes
cmix,cmix v2,,15863623,126323656,"310,068 (x)",126633724,580083,577626,28827648000,CM,3,yes
cmix,cmix v3,,15809519,125971560,"274,992 (x)",126246552,267978,266622,27321344000,CM,3,yes
cmix,cmix v4,,15784946,125621620,"278,375 (x)",125899995,284243,282390,29671424000,CM,3,yes
cmix,cmix v5,,15769367,125526628,"163,552 (s)",125690180,282056,282647,29557760000,CM,3,yes
cmix,cmix v6,,15738922,124172611,"161,908 (s)",124334519,280749,282137,31623168000,CM,3,yes
cmix,cmix v7,,15738825,124168463,"166,785 (s)",124335248,280416,280904,31334400000,CM,3,yes
cmix,cmix v8,,15709216,123930173,"164,882 (s)",124095055,344244,346641,31038464000,CM,3,yes
cmix,cmix v9,,15627536,123874398,"161,911 (s)",124036309,346436,345681,27575296000,CM,3,yes
cmix,cmix v10,,15587868,123257156,"164,263 (s)",123421419,355721,355850,30642176000,CM,3,yes
cmix,cmix v11,,15566358,122977954,"172,261 (s)",123150215,377529,374440,28410880000,CM,3,yes
cmix,cmix v12,,15440186,121718424,"175,953 (s)",121894377,571339,574522,28533760000,CM,3,yes
cmix,cmix v13,,15323969,120480684,"177,979 (s)",120658664,617346,615987,28470272000,CM,3,yes
cmix,cmix v14,,15210458,119017492,"203,717 (s)",119221209,631838,627802,28965888000,CM,2,yes
cmix,cmix v15,,15111677,117959016,"174,134 (s)",118133150,650056,651717,29046603776,CM,2,no
`.trim();
let enwik_results_all = $.csv.toObjects(enwik_results_csv);
// input data: other corporas
let id_calgary = "calgary";
let id_canterbury = "canterbury";
let id_max_comp = "max_comp";
let id_silesia = "silesia";
let names = new Map([
[id_calgary, "Calgary corpus"],
[id_canterbury, "Canterbury corpus"],
[id_max_comp, "Maximum Compression SFC test files"],
[id_silesia, "Silesia compression corpus"]
]);
let files = new Map([
[id_calgary, ["bib", "book1", "book2", "geo", "news", "obj1", "obj2", "paper1", "paper2", "pic",
"progc", "progl", "progp", "trans"]],
[id_canterbury, ["alice29.txt", "asyoulik.txt", "cp.html", "fields.c", "grammar.lsp", "kennedy.xls",
"lcet10.txt", "plrabn12.txt", "ptt5", "sum", "xargs.1"]],
[id_max_comp, ["A10.jpg", "AcroRd32.exe", "english.dic", "FlashMX.pdf", "FP.LOG", "MSO97.DLL",
"ohs.doc", "rafale.bmp", "vcfiu.hlp", "world95.txt"]],
[id_silesia, ["dickens", "mozilla", "mr", "nci", "ooffice", "osdb", "reymont", "samba", "sao",
"webster", "xml", "x-ray"]]
]);
let csv_results_by_corpus = new Map();
csv_results_by_corpus.set(id_calgary, String.raw`
program_series,program_name,program_options,bib_size,book1_size,book2_size,geo_size,news_size,obj1_size,obj2_size,paper1_size,paper2_size,pic_size,progc_size,progl_size,progp_size,trans_size,total_without_decompressor,decompressor_size,total_compressed_size,outdated,html_info
COPY,original files,,111261,768771,610856,102400,377109,21504,246814,53161,82199,513216,39611,71646,49379,93695,3141622,0,3141622,no,<u>this is a test</u>
Info-ZIP,ZIP 3.0,-1,44005,365141,248982,69944,164334,10842,94041,21749,35215,65674,15591,20174,13518,24102,1193312,"67,429 (x)",1260741,no,
Info-ZIP,ZIP 3.0,-2,41669,350635,237897,69509,159215,10754,91729,20880,33849,64024,14998,19127,13022,23023,1150331,"67,429 (x)",1217760,no,
Info-ZIP,ZIP 3.0,-3,39902,336559,228457,69612,155425,10719,89602,20247,32666,62491,14646,18446,12668,22314,1113754,"67,429 (x)",1181183,no,
Info-ZIP,ZIP 3.0,-4,37539,329065,217676,69041,149330,10532,85364,19367,31314,58773,13909,17334,11909,20446,1071599,"67,429 (x)",1139028,no,
Info-ZIP,ZIP 3.0,-5,36017,318390,209500,68845,145531,10458,82994,18838,30272,57761,13487,16666,11512,19502,1039773,"67,429 (x)",1107202,no,
Info-ZIP,ZIP 3.0,-6,35197,313512,206823,68627,144975,10458,81766,18714,29890,56576,13411,16409,11382,19121,1026861,"67,429 (x)",1094290,no,
Info-ZIP,ZIP 3.0,-7,35107,312779,206466,68574,144830,10456,81450,18687,29836,55618,13398,16336,11350,19047,1023934,"67,429 (x)",1091363,no,
Info-ZIP,ZIP 3.0,-8,35034,312417,206295,68548,144537,10457,81223,18680,29804,53282,13397,16300,11325,18998,1020297,"67,429 (x)",1087726,no,
Info-ZIP,ZIP 3.0,-9,35034,312417,206294,68548,144535,10455,81222,18680,29804,52515,13397,16300,11322,18998,1019521,"67,429 (x)",1086950,no,
bzip,bzip2 1.0.6,-1,29246,270508,183426,57195,134580,10787,80055,16558,25041,49912,12544,15579,10710,17899,914040,"37,418 (x)",951458,no,
bzip,bzip2 1.0.6,-2,27467,256002,172771,56921,126639,10787,78589,16558,25041,49759,12544,15579,10710,17899,877266,"37,418 (x)",914684,no,
bzip,bzip2 1.0.6,-3,27467,249793,166920,56921,123563,10787,76441,16558,25041,49759,12544,15579,10710,17899,859982,"37,418 (x)",897400,no,
bzip,bzip2 1.0.6,-4,27467,243402,164806,56921,118600,10787,76441,16558,25041,49759,12544,15579,10710,17899,846514,"37,418 (x)",883932,no,
bzip,bzip2 1.0.6,-5,27467,242662,163866,56921,118600,10787,76441,16558,25041,49759,12544,15579,10710,17899,844834,"37,418 (x)",882252,no,
bzip,bzip2 1.0.6,-6,27467,241169,158682,56921,118600,10787,76441,16558,25041,49759,12544,15579,10710,17899,838157,"37,418 (x)",875575,no,
bzip,bzip2 1.0.6,-7,27467,237993,157443,56921,118600,10787,76441,16558,25041,49759,12544,15579,10710,17899,833742,"37,418 (x)",871160,no,
bzip,bzip2 1.0.6,-8,27467,232598,157443,56921,118600,10787,76441,16558,25041,49759,12544,15579,10710,17899,828347,"37,418 (x)",865765,no,
bzip,bzip2 1.0.6,-9,27467,232598,157443,56921,118600,10787,76441,16558,25041,49759,12544,15579,10710,17899,828347,"37,418 (x)",865765,no,
PAQ,paq8l,-1,22915,205825,132320,47444,97998,8787,57291,13945,21541,42390,10297,11784,8152,12933,693622,"37,350 (s)",730972,no,
PAQ,paq8l,-2,22898,203456,130881,47432,97165,8786,56995,13947,21533,42404,10296,11784,8148,12935,688660,"37,350 (s)",726010,no,
PAQ,paq8l,-3,22896,202455,130328,47427,96980,8789,56932,13945,21531,42395,10294,11780,8152,12932,686836,"37,350 (s)",724186,no,
PAQ,paq8l,-4,20880,193524,122310,44076,90146,7489,45453,13100,20489,22543,9520,10622,7137,11653,618942,"37,350 (s)",656292,no,
PAQ,paq8l,-5,20844,192770,121839,43988,89859,7480,44914,13087,20478,22533,9511,10621,7128,11639,616691,"37,350 (s)",654041,no,
PAQ,paq8l,-6,20838,192368,121644,43898,89750,7479,44570,13088,20481,22536,9508,10622,7130,11629,615541,"37,350 (s)",652891,no,
PAQ,paq8l,-7,20833,192302,121616,43893,89728,7481,44421,13086,20481,22541,9508,10623,7128,11627,615268,"37,350 (s)",652618,no,
PAQ,paq8l,-8,20836,192294,121610,43894,89723,7482,44395,13087,20479,22530,9506,10623,7127,11625,615211,"37,350 (s)",652561,no,
cmix,cmix v15,,17581,176459,108340,43104,78484,7131,40712,11016,17432,22140,8479,9059,6361,10232,556530,"174,134 (s)",730664,no,
`.trim());
csv_results_by_corpus.set(id_canterbury, String.raw`
program_series,program_name,program_options,alice29.txt_size,asyoulik.txt_size,cp.html_size,fields.c_size,grammar.lsp_size,kennedy.xls_size,lcet10.txt_size,plrabn12.txt_size,ptt5_size,sum_size,xargs.1_size,total_without_decompressor,decompressor_size,total_compressed_size,outdated,html_info
COPY,original files,,152089,125179,24603,11150,3721,1029744,426754,481861,513216,38240,4227,2810784,0,2810784,no,<b>this is a test</b>
Info-ZIP,ZIP 3.0,-1,65286,56956,9192,3813,1498,245179,174273,228921,65676,14268,2010,867072,"67,429 (x)",934501,no,
Info-ZIP,ZIP 3.0,-2,62421,54808,8975,3667,1478,241706,166265,219127,64026,13971,1984,838428,"67,429 (x)",905857,no,
Info-ZIP,ZIP 3.0,-3,59633,52855,8763,3559,1473,236807,158909,209491,62493,13876,1972,809831,"67,429 (x)",877260,no,
Info-ZIP,ZIP 3.0,-4,57853,51416,8402,3381,1400,232216,152880,206003,58775,13414,1913,787653,"67,429 (x)",855082,no,
Info-ZIP,ZIP 3.0,-5,55758,49778,8185,3306,1388,209107,147306,199239,57763,13126,1894,746850,"67,429 (x)",814279,no,
Info-ZIP,ZIP 3.0,-6,54577,49094,8137,3282,1388,206921,145026,195351,56578,13058,1894,735306,"67,429 (x)",802735,no,
Info-ZIP,ZIP 3.0,-7,54420,49006,8118,3278,1388,210947,144726,194753,55620,13024,1894,737174,"67,429 (x)",804603,no,
Info-ZIP,ZIP 3.0,-8,54333,48972,8119,3275,1388,209632,144572,194420,53284,12965,1894,732854,"67,429 (x)",800283,no,
Info-ZIP,ZIP 3.0,-9,54333,48972,8119,3275,1388,209875,144570,194420,52517,12906,1894,732269,"67,429 (x)",799698,no,
bzip,bzip2 1.0.6,-1,45995,41502,7624,3039,1283,123054,124819,164084,49912,12909,1762,575983,"37,418 (x)",613401,no,
bzip,bzip2 1.0.6,-2,43202,39569,7624,3039,1283,123551,116543,157010,49759,12909,1762,556251,"37,418 (x)",593669,no,
bzip,bzip2 1.0.6,-3,43202,39569,7624,3039,1283,124998,114455,152588,49759,12909,1762,551188,"37,418 (x)",588606,no,
bzip,bzip2 1.0.6,-4,43202,39569,7624,3039,1283,124601,108965,150422,49759,12909,1762,543135,"37,418 (x)",580553,no,
bzip,bzip2 1.0.6,-5,43202,39569,7624,3039,1283,127357,107706,145577,49759,12909,1762,539787,"37,418 (x)",577205,no,
bzip,bzip2 1.0.6,-6,43202,39569,7624,3039,1283,127629,107706,145577,49759,12909,1762,540059,"37,418 (x)",577477,no,
bzip,bzip2 1.0.6,-7,43202,39569,7624,3039,1283,125261,107706,145577,49759,12909,1762,537691,"37,418 (x)",575109,no,
bzip,bzip2 1.0.6,-8,43202,39569,7624,3039,1283,125048,107706,145577,49759,12909,1762,537478,"37,418 (x)",574896,no,
bzip,bzip2 1.0.6,-9,43202,39569,7624,3039,1283,130280,107706,145577,49759,12909,1762,542710,"37,418 (x)",580128,no,
cmix,cmix v15,,31484,29766,4861,1990,795,8290,74679,113460,22140,7009,1153,295627,"174,134 (s)",469761,no,
`.trim());
csv_results_by_corpus.set(id_max_comp, String.raw`
program_series,program_name,program_options,A10.jpg_size,AcroRd32.exe_size,english.dic_size,FlashMX.pdf_size,FP.LOG_size,MSO97.DLL_size,ohs.doc_size,rafale.bmp_size,vcfiu.hlp_size,world95.txt_size,total_without_decompressor,decompressor_size,total_compressed_size,outdated,html_info
COPY,original files,,842468,3870784,4067439,4526946,20617071,3782416,4168192,4149414,4121418,2988578,53134726,0,53134726,no,<s>this is a test</s>
Info-ZIP,ZIP 3.0,-1,841167,1846133,1304391,3903436,1936140,2273121,1092278,1555327,1052918,1120670,16925581,"67,429 (x)",16993010,no,
Info-ZIP,ZIP 3.0,-2,841100,1817477,1275479,3887919,1851747,2246998,1069805,1483011,1011184,1058327,16543047,"67,429 (x)",16610476,no,
Info-ZIP,ZIP 3.0,-3,841070,1794302,1236175,3879164,1790411,2229309,1062447,1399557,978895,1018668,16229998,"67,429 (x)",16297427,no,
Info-ZIP,ZIP 3.0,-4,841603,1766373,1102308,3851861,1614571,2214880,1048511,1333961,907117,939357,15620542,"67,429 (x)",15687971,no,
Info-ZIP,ZIP 3.0,-5,841601,1739803,1049397,3838575,1516321,2197807,1031035,1294988,866033,895769,15271329,"67,429 (x)",15338758,no,
Info-ZIP,ZIP 3.0,-6,841601,1734630,1050474,3836256,1448726,2191218,1015107,1261485,848710,873334,15101541,"67,429 (x)",15168970,no,
Info-ZIP,ZIP 3.0,-7,841601,1734942,1050571,3833791,1406608,2190751,1012112,1256522,844675,868171,15039744,"67,429 (x)",15107173,no,
Info-ZIP,ZIP 3.0,-8,841601,1733235,1050643,3833359,1341407,2189182,1007923,1254621,841093,863169,14956233,"67,429 (x)",15023662,no,
Info-ZIP,ZIP 3.0,-9,841601,1732528,1050635,3833348,1338051,2189031,1007634,1254496,840628,863097,14951049,"67,429 (x)",15018478,no,
bzip,bzip2 1.0.6,-1,841511,1704286,1128958,3846860,1164788,2166371,1006378,965609,796354,804319,14425434,"37,418 (x)",14462852,no,
bzip,bzip2 1.0.6,-2,839329,1691551,1158452,3829160,966356,2138778,955087,931487,763446,717266,13990912,"37,418 (x)",14028330,no,
bzip,bzip2 1.0.6,-3,838117,1691732,1175140,3818240,880826,2125678,937112,917110,745353,669804,13799112,"37,418 (x)",13836530,no,
bzip,bzip2 1.0.6,-4,838330,1689810,1187462,3817816,831280,2120802,922592,907238,730191,648202,13693723,"37,418 (x)",13731141,no,
bzip,bzip2 1.0.6,-5,837651,1699028,1197256,3823341,798005,2117214,915098,902751,725687,626189,13642220,"37,418 (x)",13679638,no,
bzip,bzip2 1.0.6,-6,837597,1701461,1205514,3815437,771726,2113720,910551,899711,722314,610621,13588652,"37,418 (x)",13626070,no,
bzip,bzip2 1.0.6,-7,837426,1699832,1213329,3822011,753813,2114414,906302,894493,711502,600314,13553436,"37,418 (x)",13590854,no,
bzip,bzip2 1.0.6,-8,836969,1692270,1216624,3807098,736704,2108396,909061,891353,717126,591594,13507195,"37,418 (x)",13544613,no,
bzip,bzip2 1.0.6,-9,836468,1699590,1221689,3810876,723415,2110954,906814,890163,712716,577006,13489691,"37,418 (x)",13527109,no,
cmix,cmix v15,,633286,820761,321010,3530665,206128,1153919,457936,490241,363822,300923,8278691,"174,134 (s)",8452825,no,
`.trim());
csv_results_by_corpus.set(id_silesia, String.raw`
program_series,program_name,program_options,dickens_size,mozilla_size,mr_size,nci_size,ooffice_size,osdb_size,reymont_size,samba_size,sao_size,webster_size,xml_size,x-ray_size,total_without_decompressor,decompressor_size,total_compressed_size,outdated,html_info
COPY,original files,,10192446,51220480,9970564,33553445,6152192,10085684,6627202,21606400,7251944,41458703,5345280,8474240,211938580,0,211938580,no,<h3>this is a test</h3>
Info-ZIP,ZIP 3.0,-1,4582180,20686747,3846638,4623531,3294730,4069628,2376447,6347197,5568317,14977242,967302,6028381,77368340,"67,429 (x)",77435769,no,
Info-ZIP,ZIP 3.0,-2,4386401,20357852,3814291,4302452,3241083,3984278,2261377,6142439,5505027,14236747,889656,5992054,75113657,"67,429 (x)",75181086,no,
Info-ZIP,ZIP 3.0,-3,4189250,20016432,3687331,4009626,3193958,3978756,2132904,5992236,5440324,13615377,824014,5961094,73041302,"67,429 (x)",73108731,no,
Info-ZIP,ZIP 3.0,-4,4091856,19516867,3699329,3713831,3155120,3871696,2050686,5668304,5396187,12988907,809888,6084076,71046747,"67,429 (x)",71114176,no,
Info-ZIP,ZIP 3.0,-5,3946354,19161276,3714414,3378475,3115669,3797349,1929662,5519927,5370819,12433781,731404,6046482,69145612,"67,429 (x)",69213041,no,
Info-ZIP,ZIP 3.0,-6,3868916,19048883,3690705,3199587,3097219,3739713,1858767,5460673,5332960,12202118,692126,6037930,68229597,"67,429 (x)",68297026,no,
Info-ZIP,ZIP 3.0,-7,3856109,19011831,3686452,3140670,3093301,3720535,1836403,5423882,5328906,12118518,677545,6037850,67932002,"67,429 (x)",67999431,no,
Info-ZIP,ZIP 3.0,-8,3851961,18995075,3674279,3030665,3090576,3716477,1821022,5410435,5327175,12062006,663043,6037849,67680563,"67,429 (x)",67747992,no,
Info-ZIP,ZIP 3.0,-9,3851961,18994280,3674073,2987667,3090580,3716477,1820972,5408408,5327175,12061762,662418,6037849,67633622,"67,429 (x)",67701051,no,
bzip,bzip2 1.0.6,-1,3302765,18670806,2575307,2358098,3003039,3755782,1480083,5081043,5067350,10315781,567188,4331799,60509041,"37,418 (x)",60546459,no,
bzip,bzip2 1.0.6,-2,3112033,18406088,2538729,2141686,2943226,3316293,1392940,4849937,5007279,9677251,514630,4205180,58105272,"37,418 (x)",58142690,no,
bzip,bzip2 1.0.6,-3,3008000,18302776,2514092,2035566,2917026,3122035,1347244,4737931,4985363,9359580,486740,4148814,56965167,"37,418 (x)",57002585,no,
bzip,bzip2 1.0.6,-4,2949415,18159353,2494311,1970558,2887156,3022111,1317824,4668278,4977420,9155103,466196,4116812,56184537,"37,418 (x)",56221955,no,
bzip,bzip2 1.0.6,-5,2909131,18085622,2476667,1922291,2881260,2943182,1292285,4624374,4962616,8998175,452511,4092342,55640456,"37,418 (x)",55677874,no,
bzip,bzip2 1.0.6,-6,2866993,18066482,2465445,1888459,2875739,2891128,1279319,4616601,4952849,8889716,443783,4078641,55315155,"37,418 (x)",55352573,no,
bzip,bzip2 1.0.6,-7,2840343,17979557,2456928,1859576,2862964,2858479,1267135,4547946,4954431,8796175,436841,4068212,54928587,"37,418 (x)",54966005,no,
bzip,bzip2 1.0.6,-8,2821149,17947263,2447745,1832525,2855019,2824794,1253626,4547712,4951657,8713549,439554,4058715,54693308,"37,418 (x)",54730726,no,
bzip,bzip2 1.0.6,-9,2799520,17914392,2441280,1812734,2862526,2802792,1246230,4549759,4940524,8644714,441186,4051112,54506769,"37,418 (x)",54544187,no,
cmix,"cmix v15, precomp v0.4.6",precomp -cn | cmix,1840392,7161756,1912673,811610,1256130,1969208,736373,1642789,3732491,4413876,239434,3525053,29241785,"429,013 (x)",29670798,no,
`.trim());
</script>
<script>
// generic helper functions
function assert(condition, message) {
if (!condition) {
message = message || "Assertion failed";
if (typeof Error !== "undefined") {
throw new Error(message);
}
throw message; // Fallback
}
}
function escape_selector(s) {
return s.replace(/(:|\.|\[|\])/g, "\\$1");
}
function separated(number_like) {
return Number(number_like).toLocaleString();
}
// common display functions
function plot_results(copy_result, filtered_results, field_name) {
assert(copy_result !== null);
let plot_mode = $('input[name=plot_mode]:checked').val();
let plot_div = $("#results_plot")[0];
let x = [];
let y = [];
let text = [];
$.each(filtered_results, function (index, result) {
x.push("#" + (index + 1) + " " + result.program_series); // unique name
let size = result[field_name];
let ratio = copy_result[field_name] / result[field_name];
let percentage = 100.0 / ratio;
if (plot_mode === "plot_sizes") {
y.push(size);
} else if (plot_mode === "plot_percentages") {
y.push(percentage);
} else {
assert(plot_mode === "plot_ratios");
y.push(ratio);
}
text.push(result.program_name + "<br>Options: " + result.program_options + "<br>Compressed size: " +
separated(size) + " bytes<br>Percentage: " + percentage.toFixed(3) +
"% of original file size<br>Ratio: " + ratio.toFixed(3) + " : 1");
});
let data = [{
x: x,
y: y,
type: "bar",
text: text
}];
let layout = {
title: "Selected result field: <b>" + field_name + "</b>"
};
Plotly.newPlot(plot_div, data, layout);
}
function attach_nav_tab_handler(corpus_id, action) {
let nav_tab = $("#nav-" + corpus_id + "-results-tab");
nav_tab.on("shown.bs.tab", function (e) {
$("#results").data("selected_corpus_id", corpus_id);
action();
});
}
function sorted_series(input_series) {
let series = Array.from(input_series);
series.sort(function (a, b) {
a = a.toLowerCase();
b = b.toLowerCase();
if (a === "copy") return -1;
if (b === "copy") return 1;
return a === b ? 0 : a > b ? 1 : -1;
});
return new Set(series);
}
function attach_sorted_column_handlers(corpus_id, sorted_columns_ids_by_field_name, fill_table_function) {
for (let [field_name, column_id] of sorted_columns_ids_by_field_name) {
$(escape_selector("#" + column_id)).click(function () {
$("#nav-" + corpus_id + "-results").data("field_name", field_name);
fill_table_function();
});
}
}
function find_selected_options(options_selector) {
let found_options = new Set();
options_selector.find("option").each(function () {
if ($(this).prop("selected")) {
found_options.add($(this).val());
}
});
return found_options;
}
function setup_selectors_button(button_id, selector, selected_state) {
$(button_id).click(function () {
selector.find("option").prop("selected", selected_state);
selector.change();
});
}
function setup_selectors(corpus_id, corpus_program_series,
shown_series_selector, collapsed_series_selector,
outdated_series_selector, update_action) {
assert(corpus_program_series.has("COPY"));
setup_selectors_button("#" + corpus_id + "_select_all_collapsed", collapsed_series_selector, true);
setup_selectors_button("#" + corpus_id + "_select_none_collapsed", collapsed_series_selector, false);
setup_selectors_button("#" + corpus_id + "_select_all_outdated", outdated_series_selector, true);
setup_selectors_button("#" + corpus_id + "_select_none_outdated", outdated_series_selector, false);
for (let program_series of corpus_program_series) {
shown_series_selector.append("<option selected=\"selected\">" + program_series + "</option>");
}
shown_series_selector.change(function () {
collapsed_series_selector.empty();
for (let series of find_selected_options(shown_series_selector)) {
collapsed_series_selector.append("<option selected=\"selected\">" + series + "</option>");
}
collapsed_series_selector.change();
});
collapsed_series_selector.change(function () {
outdated_series_selector.empty();
let series_to_collapse = find_selected_options(collapsed_series_selector);
for (let series of find_selected_options(shown_series_selector)) {
if (!series_to_collapse.has(series)) {
outdated_series_selector.append("<option>" + series + "</option>");
}
}
outdated_series_selector.change();
});
outdated_series_selector.change(function () {
update_action();
});
shown_series_selector.change();
}
function emphasize_sorted_column(chosen_field_name, field_names_to_column_id) {
for (let [field_name, column_id] of field_names_to_column_id) {
if (field_name === chosen_field_name) {
$(escape_selector("#" + column_id)).css("text-decoration", "underline");
} else {
$(escape_selector("#" + column_id)).css("text-decoration", "");
}
}
}
function sort_by_field_length_and_value(objects_array, field_name) {
objects_array.sort(function (a, b) {
if (a[field_name].length !== b[field_name].length) {
return a[field_name].length - b[field_name].length;
} else {
return a[field_name] === b[field_name] ? 0 : a[field_name] < b[field_name] ? -1 : 1;
}
});
}
function filtered_corpus_results(corpus_results_all, shown_series_selector, collapsed_series_selector,
outdated_series_selector) {
let series_to_show = find_selected_options(shown_series_selector);
let series_to_collapse = find_selected_options(collapsed_series_selector);
let series_with_outdated_results = find_selected_options(outdated_series_selector);
let corpus_results = [];
let seen_series = new Set();
for (let single_result of corpus_results_all) {
let series = single_result.program_series;
if (series_to_show.has(series) &&
!(series_to_collapse.has(series) && seen_series.has(series)) &&
(series_with_outdated_results.has(series) || single_result.outdated === "no")) {
corpus_results.push(single_result);
seen_series.add(series);
}
}
return corpus_results;
}
// displaying enwiks results
$("#enwik_download").attr("href",
URL.createObjectURL(new Blob([enwik_results_csv], {type: "application/csv"})));
let enwik_result_of_copy = null;
let enwik_program_series = new Set();
for (let result of enwik_results_all) {
assert(result.outdated === "yes" || result.outdated === "no");
enwik_program_series.add(result.program_series);
if (result.program_series === "COPY") {
assert(enwik_result_of_copy === null);
enwik_result_of_copy = result;
}
}
enwik_program_series = sorted_series(enwik_program_series);
$("#enwik_results_dump").val(JSON.stringify(enwik_results_all));
let enwik_sorted_columns_ids_by_field_name = new Map([
["compressed_enwik8_size", "enwik8_size_column"],
["compressed_enwik9_size", "enwik9_size_column"],
["total_compressed_size", "enwik_total_size_column"]
]);
attach_sorted_column_handlers("enwik", enwik_sorted_columns_ids_by_field_name, fill_enwik_results);
attach_nav_tab_handler("enwik", fill_enwik_results);
let shown_series_selector = $("#enwik_shown_series");
let collapsed_series_selector = $("#enwik_collapsed_series");
let outdated_series_selector = $("#enwik_outdated_series");
let memory_scale_selector = $("#memory_scale_selector");
memory_scale_selector.change(function () {
fill_enwik_results();
});
setup_selectors("enwik", enwik_program_series, shown_series_selector, collapsed_series_selector,
outdated_series_selector, fill_enwik_results);
function fill_enwik_results() {
let sorted_field = $("#nav-enwik-results").data("field_name");
emphasize_sorted_column(sorted_field, enwik_sorted_columns_ids_by_field_name);
sort_by_field_length_and_value(enwik_results_all, sorted_field);
let enwik_results = filtered_corpus_results(enwik_results_all, shown_series_selector,
collapsed_series_selector, outdated_series_selector);
let body = $("#enwik_results_body");
body.empty();
let memory_scale = find_selected_options(memory_scale_selector).values().next().value;
$.each(enwik_results, function (index, result) {
let row = $("<tr></tr>");
let scaled_memory_usage = Math.round(result.memory_usage_in_bytes / memory_scale);
row.append("<td class=\"text-right\">" + (index + 1) + "</td>");
row.append("<td class=\"text-left\"><a href=\"#" + result.program_series + "_series\">" +
result.program_series + "</a></td>");
row.append("<td class=\"text-left\">" + result.program_name + "</td>");
row.append("<td class=\"text-left\">" + result.program_options + "</td>");
row.append("<td class=\"text-right\">" + separated(result.compressed_enwik8_size) + "</td>");
row.append("<td class=\"text-right\">" + separated(result.compressed_enwik9_size) + "</td>");
row.append("<td class=\"text-right\">" + result.decompressor_size + "</td>");
row.append("<td class=\"text-right\">" + separated(result.total_compressed_size) + "</td>");
row.append("<td class=\"text-right\">" + separated(result.compression_time) + "</td>");
row.append("<td class=\"text-right\">" + separated(result.decompression_time) + "</td>");
row.append("<td class=\"text-right\">" + separated(scaled_memory_usage) + "</td>");
row.append("<td class=\"text-left\">" + result.algorithm_type + "</td>");
row.append("<td class=\"text-right\"><a href=\"#note-" + result.note_id + "\">" + result.note_id +
"</a></td>");
body.append(row);
});
$("#results_title").html("Results for <a href=\"#testset_enwik\">enwik8 & enwik9</a>");
plot_results(enwik_result_of_copy, enwik_results, sorted_field);
}
// displaying other corporas results
$("#nav-enwik-results-tab").after(Array.from(names, function ([id, name]) {
return "<a class=\"nav-item nav-link\" id=\"nav-" + id + "-results-tab\" href=\"#nav-" + id +
"-results\" role=\"tab\" data-toggle=\"tab\" aria-controls=\"nav-" + id +
"-results\" aria-selected=\"false\">" + name + "</a>";
}));
$("#nav-enwik-results").after(Array.from(names, function ([id, name]) {
let headers = $("<tr></tr>");
headers.append("<th>#</th>");
headers.append("<th>Program series: name<br>options</th>");
for (let file_name of files.get(id)) {
headers.append("<th id=\"" + id + "_" + file_name + "_size_column\">" + file_name + "</th>");
}
headers.append("<th class=\"text-center\" id=\"" + id +
"_total_without_decomp_column\">Total size<br>w/o decomp</th>");
headers.append("<th class=\"text-center\">Decomp size<br>(7z or Zip)</th>");
headers.append("<th class=\"text-center\" id=\"" + id + "_total_size_column\">Total size</th>");
headers.append("<th class=\"text-left\">Info</th>");
let section = String.raw`
<div class="tab-pane" id="nav-${id}-results" role="tabpanel" aria-labelledby="nav-${id}-results-tab"
data-field_name="total_compressed_size">
<form>
<div class="row">
<div class="col form-group">
<label for="${id}_shown_series">Show compressor series</label>
<select multiple class="form-control" id="${id}_shown_series" style="height: 100%;">
<!-- filled in script -->
</select>
</div>
<div class="col form-group">
<label for="${id}_collapsed_series">Show only best non-outdated result in series</label>
<select multiple class="form-control" id="${id}_collapsed_series">
<!-- filled in script -->
</select>
<div class="row">
<button type="button" class="btn btn-secondary col-6"
id="${id}_select_all_collapsed">Select all</button>
<button type="button" class="btn btn-secondary col-6"
id="${id}_select_none_collapsed">Deselect all</button>
</div>
</div>
<div class="col form-group">
<label for="${id}_outdated_series">Show outdated results</label>
<select multiple class="form-control" id="${id}_outdated_series">
<!-- filled in script -->
</select>
<div class="row">
<button type="button" class="btn btn-secondary col-6"
id="${id}_select_all_outdated">Select all</button>
<button type="button" class="btn btn-secondary col-6"
id="${id}_select_none_outdated">Deselect all</button>
</div>
</div>
</div>
<div class="row">
<a id="${id}_download" class="btn btn-outline-success col-sm-1" role="button"
download="results_${id}.csv">
Export CSV
</a>
<label for="${id}_results_dump" class="col-sm-2 col-form-label">Raw JSON dump:</label>
<div class="col-sm-9">
<input type="text" readonly class="form-control-plaintext" id="${id}_results_dump">
</div>
</div>
</form>
<table class="table table-striped small">
<thead class="thead-dark">${headers.html()}</thead>
<tbody id="${id}_results_body"><!-- filled in script --></tbody>
</table>
</div>`;
return section;
}));
for (let [id, file_names] of files) {
let corpus_results_csv = csv_results_by_corpus.get(id);
$("#" + id + "_download").attr("href",
URL.createObjectURL(new Blob([corpus_results_csv], {type: "application/csv"})));
let corpus_results_all = $.csv.toObjects(corpus_results_csv);
let corpus_result_of_copy = null;
let corpus_program_series = new Set();
for (let result of corpus_results_all) {
assert(result.outdated === "yes" || result.outdated === "no");
corpus_program_series.add(result.program_series);
if (result.program_series === "COPY") {
assert(corpus_result_of_copy === null);
corpus_result_of_copy = result;
}
}
corpus_program_series = sorted_series(corpus_program_series);
$("#" + id + "_results_dump").val(JSON.stringify(corpus_results_all));
let corpus_sorted_columns_by_field = new Map();
for (let file_name of file_names) {
corpus_sorted_columns_by_field.set(file_name + "_size", id + "_" + file_name + "_size_column");
}
corpus_sorted_columns_by_field.set("total_without_decompressor", id + "_total_without_decomp_column");
corpus_sorted_columns_by_field.set("total_compressed_size", id + "_total_size_column");
attach_sorted_column_handlers(id, corpus_sorted_columns_by_field, fill_corpus_results);
attach_nav_tab_handler(id, fill_corpus_results);
let shown_series_selector = $("#" + id + "_shown_series");
let collapsed_series_selector = $("#" + id + "_collapsed_series");
let outdated_series_selector = $("#" + id + "_outdated_series");
setup_selectors(id, corpus_program_series, shown_series_selector, collapsed_series_selector,
outdated_series_selector, fill_corpus_results);
function fill_corpus_results() {
let sorted_field = $("#nav-" + id + "-results").data("field_name");
emphasize_sorted_column(sorted_field, corpus_sorted_columns_by_field);
sort_by_field_length_and_value(corpus_results_all, sorted_field);
let corpus_results = filtered_corpus_results(corpus_results_all, shown_series_selector,
collapsed_series_selector, outdated_series_selector);
let body = $("#" + id + "_results_body");
body.empty();
$.each(corpus_results, function (index, result) {
let row = $("<tr></tr>");
row.append("<td class=\"text-right\">" + (index + 1) + "</td>");
let program_series_and_name = "<a href=\"#" + result.program_series + "_series\">" +
result.program_series + "</a>: " + result.program_name;
let program_description = result.program_options.trim() ?
(program_series_and_name + "<br>" + result.program_options) :
program_series_and_name;
row.append("<td class=\"text-left\">" + program_description + "</td>");
for (let file_name of file_names) {
row.append("<td class=\"text-right\">" + separated(result[file_name + "_size"]) + "</td>");
}
row.append("<td class=\"text-right\">" + separated(result.total_without_decompressor) +
"</td>");
row.append("<td class=\"text-right\">" + result.decompressor_size + "</td>");
row.append("<td class=\"text-right\">" + separated(result.total_compressed_size) + "</td>");
if (result.html_info) {
let button_html = "<button type=\"button\" class=\"btn btn-primary btn-sm\" " +
"data-toggle=\"modal\" data-target=\"#info_modal\" " +
"style=\"margin: 0; padding: 0;\">Info</button>";
let info_button = $(button_html);
info_button.attr("data-program_series_and_name",
result.program_series + ": " + result.program_name);
info_button.attr("data-html_info", result.html_info);
row.append("<td>" + info_button.prop("outerHTML") + "</td>");
} else {
row.append("<td></td>");
}
body.append(row);
});
$("#results_title").html("Results for <a href=\"#testset_" + id + "\">" + names.get(id) + "</a>");
plot_results(corpus_result_of_copy, corpus_results, sorted_field);
}
}
fill_enwik_results(); // needs to override all previous fills that happened on page load
$("input:radio[name=plot_mode]").click(function() {
let id = $("#results").data("selected_corpus_id");
let outdated_series_selector = $("#" + id + "_outdated_series");
outdated_series_selector.change();
});
$("#info_modal").on("show.bs.modal", function (event) {
let button = $(event.relatedTarget);
let program_series_and_name = button.data("program_series_and_name");
let html_info = button.data("html_info");
let modal = $(this);
modal.find("#info_modal_title").text(program_series_and_name);
modal.find("#info_modal_content").html(html_info);
});
$(window).resize(function () {
let plot_div = $("#results_plot")[0];
Plotly.Plots.resize(plot_div);
});
</script>
<script src="https://unpkg.com/popper.js@1.12.6/dist/umd/popper.js"
integrity="sha384-fA23ZRQ3G/J53mElWqVJEGJzU0sTs+SvzG8fXVWP+kJQ1lwFAOkcUOysnlKJC33U"
crossorigin="anonymous"></script>
<script src="https://unpkg.com/bootstrap-material-design@4.1.1/dist/js/bootstrap-material-design.js"
integrity="sha384-CauSuKpEqAFajSpkdjv3z9t8E7RlpJ1UP0lKM/+NdtSarroVKu069AlsRPKkFBz9"
crossorigin="anonymous"></script>
<script>
$(document).ready(function () {
$("body").bootstrapMaterialDesign();
});
</script>
</body>
</html>
<!--
This page won't work in Internet Explorer 11 and some other browsers because it uses e.g. String.raw() feature:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw
-->