Configuration

Choose a dataset

Different codecs can behave very differently with different data. Some are great at compressing text but horrible with binary data, some excel with more repetitive data like logs. Many have long initialization times but are fast once they get started, while others can compress/decompress small buffers almost instantly.

This benchmark is run against many standard datasets. Hopefully one of them is interesting for you, but if not don't worry—you can use Squash to easily run your own benchmark with whatever data you want. That said, if you think you have a somewhat common use case, please let us know—we may be interested in adding the data to this benchmark.

Note

The default dataset is selected randomly.

Name Source Description Size
Canterbury Corpus English text 148.52 KiB
Canterbury Corpus Shakespeare 122.25 KiB
Canterbury Corpus HTML source 24.03 KiB
Silesia Corpus Collected works of Charles Dickens 9.72 MiB
Large Text Compression Benchmark The first 10⁸ bytes of the English Wikipedia dump on Mar. 3, 2006 95.37 MiB
Canterbury Corpus C source 10.89 KiB
Snappy A JPEG image 120.21 KiB
Snappy A set of Protocol Buffer data 115.81 KiB
Canterbury Corpus LISP source 3.63 KiB
Canterbury Corpus Excel Spreadsheet 1005.61 KiB
Canterbury Corpus Technical writing 416.75 KiB
Silesia Corpus Tarred executables of Mozilla 1.0 (Tru64 UNIX edition) 48.85 MiB
Silesia Corpus Medical magnetic resonanse image 9.51 MiB
Silesia Corpus Chemical database of structures 32 MiB
Silesia Corpus A dll from Open Office.org 1.01 5.87 MiB
Silesia Corpus Sample database in MySQL format from Open Source Database Benchmark 9.62 MiB
Snappy A PDF 100 KiB
Canterbury Corpus Poetry 470.57 KiB
Canterbury Corpus CCITT test set 501.19 KiB
Silesia Corpus Text of the book Chłopi by Władysław Reymont 6.32 MiB
Silesia Corpus Tarred source code of Samba 2-2.3 20.61 MiB
Silesia Corpus The SAO star catalog 6.92 MiB
Canterbury Corpus SPARC Executable 37.34 KiB
Snappy List of 10000 URLs 685.63 KiB
Silesia Corpus The 1913 Webster Unabridged Dictionary 39.54 MiB
Silesia Corpus X-ray medical picture 8.08 MiB
Canterbury Corpus GNU manual page 4.13 KiB
Silesia Corpus Collected XML files 5.1 MiB

Choose a machine

If you think certain algorithms are always faster, you've got another thing coming! Different CPUs can behave very differently with the same data.

The Squash benchmark is currently run on many of the machines I have access to—this happens to be fairly recent Intel CPUs, and a mix of ARM SBCs. There is an entry in the FAQ with more details.

Note

The default machine is selected randomly.

Name Status CPU/SoC Architecture Clock Speed Memory Platform Distro Kernel Compiler CSV
Texas Instruments DM3730 armv7l 1 GHz 512 MiB BeagleBoard-xM revision B Ubuntu 15.04 4.1.5 gcc-4.9.2
Intel® Core™ i3-2105 x86_64 3.1 GHz 8 GiB Asus P8H61-H Fedora 22 4.1.4 gcc-5.1.1
Intel® Core™ i7-2630QM x86_64 2 GHz 6 GiB Toshiba Satellite A660-X Fedora 22 4.1.4 gcc-5.1.1
Amlogic S805 armv7l 1.5 GHz 1 GiB ODROID-C1 Ubuntu 14.04.4 3.10.80 gcc-4.9.2
Intel® Xeon® Processor E3-1225 v3 x86_64 3.2 GHz 20 GiB Lenovo ThinkServer TS140 Fedora 22 4.1.6 gcc-5.1.1
Intel® Atom™ D525 x86_64 1.8 GHz 4 GiB Asus AT5NM10T-I Fedora 22 4.1.4 gcc-5.1.1
Broadcom BCM2709 armv7l 900 MHz 1 GiB Raspberry Pi 2 Model B Raspbian Jessie 4.1.6 gcc-4.9.2
Intel® Core™ i5-2400 x86_64 3.1 GHz 4 GiB Asus P8Z68-V Fedora 22 4.1.4 gcc-5.1.1
Intel® Celeron® Processor 540 x86_64 1.86 GHz 1 GiB Toshiba Satellite A205-S5805 Fedora 21 4.1.6 gcc-4.9.2

Results

  1. Compression Ratio vs. Compression Speed
  2. Compression Ratio vs. Decompression Speed
  3. Compression Speed vs. Decompression Speed
  4. Round-Trip vs. Compression Ratio
  5. Transfer + Processing
  6. Optimal Codecs
  7. Results Table

Note that we do provide access to the raw data if you would prefer to generate your own charts.

Compression Ratio vs. Compression Speed

Created with Highcharts 6.2.0Compression SpeedRatiobrieflzbrotlibscbzip2crushcscdensityfarifastlzgipfelilz4lzflzglzhamlzjblzmalzoms-compressncompresspithyquicklzsnappywflzyalz77zlibzlib-ngzpaqzstd0 B/s4.77 MiB/s9.54 MiB/s14.31 MiB/s19.07 MiB/s23.84 MiB/s28.61 MiB/s33.38 MiB/s38.15 MiB/s42.92 MiB/s47.68 MiB/s52.45 MiB/s0.7511.251.51.7522.252.52.7533.25Highcharts.com

Compression Ratio vs. Decompression Speed

Created with Highcharts 6.2.0Decompression SpeedRatiobrieflzbrotlibscbzip2crushcscdensityfarifastlzgipfelilz4lzflzglzhamlzjblzmalzoms-compressncompresspithyquicklzsnappywflzyalz77zlibzlib-ngzpaqzstd0 B/s9.54 MiB/s19.07 MiB/s28.61 MiB/s38.15 MiB/s47.68 MiB/s57.22 MiB/s66.76 MiB/s76.29 MiB/s85.83 MiB/s95.37 MiB/s0.7511.251.51.7522.252.52.7533.25Highcharts.com

Compression Speed vs. Decompression Speed

Created with Highcharts 6.2.0Decompression SpeedCompression Speedbrieflzbrotlibscbzip2crushcscdensityfarifastlzgipfelilz4lzflzglzhamlzjblzmalzoms-compressncompresspithyquicklzsnappywflzyalz77zlibzlib-ngzpaqzstd0 B/s9.54 MiB/s19.07 MiB/s28.61 MiB/s38.15 MiB/s47.68 MiB/s57.22 MiB/s66.76 MiB/s76.29 MiB/s85.83 MiB/s95.37 MiB/s0 B/s9.54 MiB/s19.07 MiB/s28.61 MiB/s38.15 MiB/s47.68 MiB/s57.22 MiB/sHighcharts.com

Round Trip Speed vs. Compression Ratio

Created with Highcharts 6.2.0Round Trip SpeedCompression Ratiobrieflzbrotlibscbzip2crushcscdensityfarifastlzgipfelilz4lzflzglzhamlzjblzmalzoms-compressncompresspithyquicklzsnappywflzyalz77zlibzlib-ngzpaqzstd0 B/s4.77 MiB/s9.54 MiB/s14.31 MiB/s19.07 MiB/s23.84 MiB/s28.61 MiB/s33.38 MiB/s38.15 MiB/s42.92 MiB/s47.68 MiB/s52.45 MiB/s11.251.51.7522.252.52.7533.25Highcharts.com

Transfer + Processing

Sometimes all you care about is how long something takes to load or save, and how much disk space or bandwidth is used doesn't really matter. For example, if you have a file that would take 1 second to load if uncompressed and you could cut the file size in half by compressing it, as long as decompressing takes less than half a second the content is available sooner than it would have been without compression.

Note

For the presets I have tried to provide typical real-world speeds, not theoretical peaks. This can be significantly less than the advertised speed.

When entering custom values please keep in mind that this uses bytes per second, not bits per second. Also, it uses binary prefixes (1 MiB is 1024 KiB, not 1000).

Created with Highcharts 6.2.0Transfer + Decompression TimeDecompressionTransferNo compression00.0000020.0000040.0000060.0000080.000010.0000120.0000140.0000160.0000180.000020.0000220.0000240.0000260.0000280.000030.0000320.0…0.000034Highcharts.com

Optimal Codecs

Created with Highcharts 6.2.0SpeedRatioCompressionDecompressionAverage0 B/s9.54 MiB/s19.07 MiB/s28.61 MiB/s38.15 MiB/s47.68 MiB/s57.22 MiB/s66.76 MiB/s76.29 MiB/s85.83 MiB/s95.37 MiB/s0.7511.251.51.7522.252.52.7533.25Highcharts.com

Results

Plugin Codec Level Compression Ratio Compression Speed Decompression Speed
brieflz brieflz
1.88
2.21 MiB/s
29 MiB/s
brotli brotli 1
2.31
4.56 MiB/s
38.39 MiB/s
brotli brotli 2
2.31
4.31 MiB/s
38.39 MiB/s
brotli brotli 3
2.33
4.08 MiB/s
38.76 MiB/s
brotli brotli 4
2.40
2.31 MiB/s
35.36 MiB/s
brotli brotli 5
2.55
1.43 MiB/s
33.32 MiB/s
brotli brotli 6
2.56
935.19 KiB/s
33.59 MiB/s
brotli brotli 7
2.56
416.58 KiB/s
33.88 MiB/s
brotli brotli 8
2.56
346.3 KiB/s
33.88 MiB/s
brotli brotli 9
2.57
310.25 KiB/s
33.88 MiB/s
brotli brotli 10
2.93
85.22 KiB/s
33.88 MiB/s
brotli brotli 11
2.93
85.38 KiB/s
33.88 MiB/s
bsc bsc
2.43
686.16 KiB/s
1.18 MiB/s
bzip2 bzip2 1
2.40
1.63 MiB/s
7.01 MiB/s
bzip2 bzip2 2
2.40
1.63 MiB/s
6.97 MiB/s
bzip2 bzip2 3
2.40
1.69 MiB/s
6.96 MiB/s
bzip2 bzip2 4
2.40
1.67 MiB/s
6.91 MiB/s
bzip2 bzip2 5
2.40
1.68 MiB/s
6.95 MiB/s
bzip2 bzip2 6
2.40
1.68 MiB/s
8.84 MiB/s
bzip2 bzip2 7
2.40
1.68 MiB/s
8.84 MiB/s
bzip2 bzip2 8
2.40
1.67 MiB/s
8.84 MiB/s
bzip2 bzip2 9
2.40
1.68 MiB/s
8.84 MiB/s
copy copy
1.00
61.08 MiB/s
63.99 MiB/s
crush crush 0
2.01
34.71 KiB/s
10.15 MiB/s
crush crush 1
2.03
34.79 KiB/s
10.13 MiB/s
crush crush 2
2.05
34.67 KiB/s
10.13 MiB/s
csc csc 1
2.13
21.18 KiB/s
2.99 MiB/s
csc csc 2
2.17
14.46 KiB/s
3.02 MiB/s
csc csc 3
2.17
14.34 KiB/s
3.02 MiB/s
csc csc 4
2.19
14.35 KiB/s
3.04 MiB/s
csc csc 5
2.19
6.26 KiB/s
3.02 MiB/s
density density 1
1.12
5.59 MiB/s
6.03 MiB/s
density density 7
1.12
2.27 MiB/s
2.3 MiB/s
density density 9
1.15
970.14 KiB/s
964.69 KiB/s
fari fari
1.33
2.9 MiB/s
2.81 MiB/s
fastlz fastlz 1
1.72
27.24 MiB/s
35.67 MiB/s
fastlz fastlz 2
1.72
26.7 MiB/s
35.36 MiB/s
gipfeli gipfeli
1.91
2.42 MiB/s
34.45 MiB/s
lz4 lz4f 0
1.59
13.13 MiB/s
17.01 MiB/s
lz4 lz4f 1
1.59
13.39 MiB/s
17.3 MiB/s
lz4 lz4f 2
1.59
12.96 MiB/s
17.15 MiB/s
lz4 lz4f 3
1.73
4.85 MiB/s
17.38 MiB/s
lz4 lz4f 4
1.74
4.83 MiB/s
17.23 MiB/s
lz4 lz4f 5
1.74
4.8 MiB/s
17.15 MiB/s
lz4 lz4f 6
1.74
4.8 MiB/s
17.45 MiB/s
lz4 lz4f 7
1.74
4.77 MiB/s
16.8 MiB/s
lz4 lz4f 8
1.74
4.78 MiB/s
17.01 MiB/s
lz4 lz4f 9
1.74
4.8 MiB/s
17.23 MiB/s
lz4 lz4f 10
1.74
4.75 MiB/s
16.94 MiB/s
lz4 lz4f 11
1.74
4.8 MiB/s
16.94 MiB/s
lz4 lz4f 12
1.74
4.76 MiB/s
16.59 MiB/s
lz4 lz4f 13
1.74
4.78 MiB/s
17.15 MiB/s
lz4 lz4f 14
1.74
4.78 MiB/s
17.15 MiB/s
lz4 lz4f 15
1.74
4.8 MiB/s
17.15 MiB/s
lz4 lz4f 16
1.74
4.78 MiB/s
16.19 MiB/s
lz4 lz4 1
1.00
48.57 MiB/s
49.16 MiB/s
lz4 lz4 2
1.00
50.39 MiB/s
47.99 MiB/s
lz4 lz4 3
1.04
48.57 MiB/s
47.43 MiB/s
lz4 lz4 4
1.13
42.88 MiB/s
47.99 MiB/s
lz4 lz4 5
1.33
38.39 MiB/s
46.87 MiB/s
lz4 lz4 6
1.48
35.05 MiB/s
46.34 MiB/s
lz4 lz4 7
1.60
33.04 MiB/s
45.81 MiB/s
lz4 lz4 8
1.73
11.39 MiB/s
44.79 MiB/s
lz4 lz4 9
1.75
11.14 MiB/s
45.29 MiB/s
lz4 lz4 10
1.75
10.95 MiB/s
45.81 MiB/s
lz4 lz4 11
1.75
10.81 MiB/s
45.29 MiB/s
lz4 lz4 12
1.75
11.14 MiB/s
45.29 MiB/s
lz4 lz4 13
1.75
11.11 MiB/s
45.29 MiB/s
lz4 lz4 14
1.75
11.04 MiB/s
44.79 MiB/s
lzf lzf
1.73
17.76 MiB/s
39.52 MiB/s
lzg lzg 1
1.72
850.59 KiB/s
40.31 MiB/s
lzg lzg 2
1.77
851.47 KiB/s
40.72 MiB/s
lzg lzg 3
1.77
836.12 KiB/s
40.72 MiB/s
lzg lzg 4
1.77
834.43 KiB/s
41.13 MiB/s
lzg lzg 5
1.77
825.59 KiB/s
40.72 MiB/s
lzg lzg 6
1.77
827.9 KiB/s
40.72 MiB/s
lzg lzg 7
1.77
818.22 KiB/s
40.31 MiB/s
lzg lzg 8
1.77
829.57 KiB/s
77.52 MiB/s
lzg lzg 9
1.77
579.52 KiB/s
77.52 MiB/s
lzham lzham 0
2.08
554.08 KiB/s
6.62 MiB/s
lzham lzham 1
2.16
506.62 KiB/s
6.84 MiB/s
lzham lzham 2
2.16
502.12 KiB/s
6.82 MiB/s
lzham lzham 3
2.16
500.96 KiB/s
6.89 MiB/s
lzham lzham 4
2.16
271.29 KiB/s
6.83 MiB/s
lzjb lzjb
1.52
30.31 MiB/s
34.16 MiB/s
lzma lzma1 1
2.34
671.32 KiB/s
10.34 MiB/s
lzma lzma1 2
2.35
446.79 KiB/s
10.34 MiB/s
lzma lzma1 3
2.35
349.44 KiB/s
10.31 MiB/s
lzma lzma1 4
2.40
287.12 KiB/s
10.44 MiB/s
lzma lzma1 5
2.41
285.41 KiB/s
10.47 MiB/s
lzma lzma1 6
2.41
294.37 KiB/s
10.55 MiB/s
lzma lzma1 7
2.41
230.68 KiB/s
10.55 MiB/s
lzma lzma1 8
2.41
220.23 KiB/s
7.95 MiB/s
lzma lzma1 9
2.41
221.11 KiB/s
7.95 MiB/s
lzma lzma2 1
2.34
673.51 KiB/s
10.34 MiB/s
lzma lzma2 2
2.35
447.96 KiB/s
10.34 MiB/s
lzma lzma2 3
2.35
350.3 KiB/s
10.36 MiB/s
lzma lzma2 4
2.40
291.38 KiB/s
10.42 MiB/s
lzma lzma2 5
2.41
295.04 KiB/s
10.47 MiB/s
lzma lzma2 6
2.41
293.22 KiB/s
10.53 MiB/s
lzma lzma2 7
2.41
231.01 KiB/s
10.53 MiB/s
lzma lzma2 8
2.41
220.51 KiB/s
7.95 MiB/s
lzma lzma2 9
2.41
221.5 KiB/s
7.9 MiB/s
lzma lzma 1
2.33
670.99 KiB/s
10.31 MiB/s
lzma lzma 2
2.33
450.21 KiB/s
10.31 MiB/s
lzma lzma 3
2.33
351.55 KiB/s
10.31 MiB/s
lzma lzma 4
2.38
290.9 KiB/s
10.39 MiB/s
lzma lzma 5
2.39
294.6 KiB/s
10.5 MiB/s
lzma lzma 6
2.39
294.31 KiB/s
10.53 MiB/s
lzma lzma 7
2.39
231.09 KiB/s
10.53 MiB/s
lzma lzma 8
2.39
221.61 KiB/s
7.83 MiB/s
lzma lzma 9
2.39
218.06 KiB/s
7.95 MiB/s
lzma xz 1
2.27
660.47 KiB/s
9.69 MiB/s
lzma xz 2
2.28
440.12 KiB/s
9.71 MiB/s
lzma xz 3
2.28
343.88 KiB/s
9.74 MiB/s
lzma xz 4
2.32
285.99 KiB/s
9.76 MiB/s
lzma xz 5
2.33
293.05 KiB/s
9.81 MiB/s
lzma xz 6
2.33
292.04 KiB/s
9.86 MiB/s
lzma xz 7
2.33
223.94 KiB/s
9.76 MiB/s
lzma xz 8
2.33
220.36 KiB/s
7.51 MiB/s
lzma xz 9
2.33
219.43 KiB/s
7.48 MiB/s
lzo lzo1b 1
1.66
13.09 MiB/s
38.39 MiB/s
lzo lzo1b 2
1.68
12.88 MiB/s
38.76 MiB/s
lzo lzo1b 3
1.69
12.52 MiB/s
38.76 MiB/s
lzo lzo1b 4
1.74
12.33 MiB/s
38.03 MiB/s
lzo lzo1b 5
1.74
11.72 MiB/s
38.03 MiB/s
lzo lzo1b 6
1.77
11.07 MiB/s
37.67 MiB/s
lzo lzo1b 7
1.78
11.17 MiB/s
38.03 MiB/s
lzo lzo1b 8
1.79
10.08 MiB/s
37.67 MiB/s
lzo lzo1b 9
1.82
9.93 MiB/s
38.39 MiB/s
lzo lzo1b 99
1.84
3.79 MiB/s
38.03 MiB/s
lzo lzo1b 999
1.90
5.23 MiB/s
80.62 MiB/s
lzo lzo1c 1
1.68
11.11 MiB/s
38.03 MiB/s
lzo lzo1c 2
1.70
10.95 MiB/s
38.03 MiB/s
lzo lzo1c 3
1.70
10.69 MiB/s
38.03 MiB/s
lzo lzo1c 4
1.75
10.47 MiB/s
38.39 MiB/s
lzo lzo1c 5
1.75
9.93 MiB/s
37.33 MiB/s
lzo lzo1c 6
1.78
9.4 MiB/s
37.33 MiB/s
lzo lzo1c 7
1.80
9.53 MiB/s
38.03 MiB/s
lzo lzo1c 8
1.80
8.88 MiB/s
36.65 MiB/s
lzo lzo1c 9
1.83
8.69 MiB/s
37.33 MiB/s
lzo lzo1c 99
1.85
3.18 MiB/s
38.03 MiB/s
lzo lzo1c 999
1.92
6.36 MiB/s
38.03 MiB/s
lzo lzo1f 1
1.73
11.11 MiB/s
36.65 MiB/s
lzo lzo1f 999
2.00
6.22 MiB/s
35.99 MiB/s
lzo lzo1x 1
1.72
24.58 MiB/s
37.33 MiB/s
lzo lzo1x 11
1.68
31.74 MiB/s
35.99 MiB/s
lzo lzo1x 12
1.70
30.54 MiB/s
36.65 MiB/s
lzo lzo1x 15
1.71
27.24 MiB/s
36.98 MiB/s
lzo lzo1x 999
2.05
2.97 MiB/s
34.75 MiB/s
lzo lzo1y 1
1.70
24.88 MiB/s
36.98 MiB/s
lzo lzo1y 999
2.04
2.95 MiB/s
35.36 MiB/s
lzo lzo1z 999
2.05
2.87 MiB/s
33.59 MiB/s
ms-compress lznt1
1.97
1.08 MiB/s
87.63 MiB/s
ms-compress xpress
1.95
10.55 MiB/s
37.67 MiB/s
ms-compress xpress-huffman
2.11
6.74 MiB/s
28.39 MiB/s
ncompress compress
1.81
4.46 MiB/s
20.26 MiB/s
pithy pithy 0
1.62
31.74 MiB/s
47.43 MiB/s
pithy pithy 1
1.65
31.25 MiB/s
47.43 MiB/s
pithy pithy 2
1.66
27.99 MiB/s
46.87 MiB/s
pithy pithy 3
1.68
26.87 MiB/s
46.87 MiB/s
pithy pithy 4
1.68
26.87 MiB/s
47.99 MiB/s
pithy pithy 5
1.70
26.7 MiB/s
47.43 MiB/s
pithy pithy 6
1.70
25.84 MiB/s
47.43 MiB/s
pithy pithy 7
1.70
25.19 MiB/s
47.43 MiB/s
pithy pithy 8
1.70
26.18 MiB/s
47.43 MiB/s
pithy pithy 9
1.71
26.01 MiB/s
46.87 MiB/s
quicklz quicklz
1.71
24.28 MiB/s
24.88 MiB/s
snappy snappy
1.68
24 MiB/s
43.82 MiB/s
snappy snappy-framed
1.67
21.67 MiB/s
38.39 MiB/s
wflz wflz 1
1.41
2.22 MiB/s
55.99 MiB/s
wflz wflz 2
1.49
731 KiB/s
56.78 MiB/s
wflz wflz-chunked 1
1.39
2.23 MiB/s
57.59 MiB/s
wflz wflz-chunked 2
1.48
730.74 KiB/s
58.42 MiB/s
yalz77 yalz77
1.60
676.49 KiB/s
74.65 MiB/s
zlib deflate 1
2.29
8.65 MiB/s
26.01 MiB/s
zlib deflate 2
2.32
8.43 MiB/s
26.18 MiB/s
zlib deflate 3
2.34
8.47 MiB/s
26.52 MiB/s
zlib deflate 4
2.42
7.4 MiB/s
26.35 MiB/s
zlib deflate 5
2.44
6.93 MiB/s
26.7 MiB/s
zlib deflate 6
2.44
6.87 MiB/s
26.7 MiB/s
zlib deflate 7
2.44
6.88 MiB/s
26.7 MiB/s
zlib deflate 8
2.44
6.84 MiB/s
26.35 MiB/s
zlib deflate 9
2.44
6.87 MiB/s
26.87 MiB/s
zlib gzip 1
2.27
8.42 MiB/s
26.18 MiB/s
zlib gzip 2
2.30
8.35 MiB/s
26.18 MiB/s
zlib gzip 3
2.31
8.14 MiB/s
26.35 MiB/s
zlib gzip 4
2.39
7.24 MiB/s
26.52 MiB/s
zlib gzip 5
2.42
6.79 MiB/s
26.52 MiB/s
zlib gzip 6
2.42
6.71 MiB/s
26.35 MiB/s
zlib gzip 7
2.42
6.67 MiB/s
25.35 MiB/s
zlib gzip 8
2.42
6.66 MiB/s
26.52 MiB/s
zlib gzip 9
2.42
6.65 MiB/s
26.52 MiB/s
zlib zlib 1
2.28
8.6 MiB/s
26.87 MiB/s
zlib zlib 2
2.31
8.36 MiB/s
27.24 MiB/s
zlib zlib 3
2.33
8.21 MiB/s
27.42 MiB/s
zlib zlib 4
2.41
7.29 MiB/s
27.61 MiB/s
zlib zlib 5
2.43
6.83 MiB/s
27.8 MiB/s
zlib zlib 6
2.43
6.79 MiB/s
27.8 MiB/s
zlib zlib 7
2.43
6.8 MiB/s
27.42 MiB/s
zlib zlib 8
2.43
6.72 MiB/s
27.8 MiB/s
zlib zlib 9
2.43
6.72 MiB/s
27.61 MiB/s
zlib-ng deflate 1
2.29
8.63 MiB/s
25.84 MiB/s
zlib-ng deflate 2
2.32
8.42 MiB/s
26.18 MiB/s
zlib-ng deflate 3
2.34
8.47 MiB/s
26.18 MiB/s
zlib-ng deflate 4
2.42
7.45 MiB/s
26.35 MiB/s
zlib-ng deflate 5
2.44
6.96 MiB/s
26.52 MiB/s
zlib-ng deflate 6
2.44
6.86 MiB/s
26.52 MiB/s
zlib-ng deflate 7
2.44
6.9 MiB/s
26.7 MiB/s
zlib-ng deflate 8
2.44
6.93 MiB/s
26.7 MiB/s
zlib-ng deflate 9
2.44
6.9 MiB/s
26.52 MiB/s
zlib-ng gzip 1
2.27
8.26 MiB/s
25.51 MiB/s
zlib-ng gzip 2
2.30
8.31 MiB/s
26.01 MiB/s
zlib-ng gzip 3
2.31
8.26 MiB/s
26.01 MiB/s
zlib-ng gzip 4
2.39
7.32 MiB/s
26.01 MiB/s
zlib-ng gzip 5
2.42
6.74 MiB/s
26.01 MiB/s
zlib-ng gzip 6
2.42
6.62 MiB/s
26.18 MiB/s
zlib-ng gzip 7
2.42
6.81 MiB/s
26.18 MiB/s
zlib-ng gzip 8
2.42
6.73 MiB/s
26.35 MiB/s
zlib-ng gzip 9
2.42
6.76 MiB/s
26.35 MiB/s
zlib-ng zlib 1
2.28
8.56 MiB/s
27.05 MiB/s
zlib-ng zlib 2
2.31
8.45 MiB/s
27.05 MiB/s
zlib-ng zlib 3
2.33
8.23 MiB/s
27.05 MiB/s
zlib-ng zlib 4
2.41
7.42 MiB/s
27.42 MiB/s
zlib-ng zlib 5
2.43
6.91 MiB/s
27.24 MiB/s
zlib-ng zlib 6
2.43
6.88 MiB/s
27.61 MiB/s
zlib-ng zlib 7
2.43
6.87 MiB/s
27.8 MiB/s
zlib-ng zlib 8
2.43
6.82 MiB/s
27.61 MiB/s
zlib-ng zlib 9
2.43
6.82 MiB/s
27.42 MiB/s
zpaq zpaq 1
1.51
496.8 KiB/s
1.56 MiB/s
zpaq zpaq 2
1.64
706.23 KiB/s
1.52 MiB/s
zpaq zpaq 3
2.10
325.52 KiB/s
420.45 KiB/s
zpaq zpaq 4
2.62
124 KiB/s
124.88 KiB/s
zpaq zpaq 5
2.39
11.62 KiB/s
11.72 KiB/s
zstd zstd
2.17
8.74 MiB/s
27.8 MiB/s

Codec Details

Library Name Version License Plugin Codec Streaming Flushing Levels
BriefLZ bcaa6a1e MIT brieflz brieflz
Brotli 1dd66ef1 Apache 2.0 brotli brotli 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
bsc b2b07421 Apache 2.0 bsc bsc
bzip2 1.0.6 zlib & 3-clause BSD hybrid bzip2 bzip2 1, 2, 3, 4, 5, 6, 7, 8, 9
copy copy
CRUSH 1.0 Public Domain crush crush 0, 1, 2
CSC c8f1580b MIT csc csc 1, 2, 3, 4, 5
DENSITY 3-clause BSD density density 1, 7, 9
FastARI 19845efa MIT fari fari
FastLZ 12 MIT fastlz fastlz 1, 2
Gipfeli 65b97213 3-clause BSD gipfeli gipfeli
LZ4 d86dc916 3-clause BSD lz4 lz4 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
lz4f 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
liblzf 3.8 2-clause BSD or GPLv2+ lzf lzf
liblzg 1.0.8 zlib lzg lzg 1, 2, 3, 4, 5, 6, 7, 8, 9
LZHAM fb1a9b0a MIT lzham lzham 0, 1, 2, 3, 4
LZJB CDDL lzjb lzjb
XZ Utils 5.2.1 Public Domain lzma lzma 1, 2, 3, 4, 5, 6, 7, 8, 9
lzma1 1, 2, 3, 4, 5, 6, 7, 8, 9
lzma2 1, 2, 3, 4, 5, 6, 7, 8, 9
xz 1, 2, 3, 4, 5, 6, 7, 8, 9
LZO 2.09 GPLv2+ lzo lzo1b 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 999
lzo1c 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 999
lzo1f 1, 999
lzo1x 1, 11, 12, 15, 999
lzo1y 1, 999
lzo1z 999
ms-compress 8ba2fb09 GPLv3+ ms-compress lznt1
xpress
xpress-huffman
ncompress 4.2.4.4 Public Domain ncompress compress
Pithy d7d5bd3a 3-clause BSD pithy pithy 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
QuickLZ 1.5.0 GPL v1, v2, or v3 quicklz quicklz
Snappy 0852af76 3-clause BSD snappy snappy
snappy-framed
wfLZ cfbb02d7 wflz wflz 1, 2
wflz-chunked 1, 2
yalz77 36429ac6 yalz77 yalz77
zlib 1.2.8 zlib zlib deflate 1, 2, 3, 4, 5, 6, 7, 8, 9
gzip 1, 2, 3, 4, 5, 6, 7, 8, 9
zlib 1, 2, 3, 4, 5, 6, 7, 8, 9
zlib-ng c81cad98 zlib zlib-ng deflate 1, 2, 3, 4, 5, 6, 7, 8, 9
gzip 1, 2, 3, 4, 5, 6, 7, 8, 9
zlib 1, 2, 3, 4, 5, 6, 7, 8, 9
ZPAQ 7.05 Public Domain zpaq zpaq 1, 2, 3, 4, 5
Zstandard 9c57b424 2-clause BSD zstd zstd

FAQ

Well, okay, I'm writing this before I publish the URL, so not so much "frequently asked questions" as "things I thought you might be wondering", but if I called this section "TITYMBW" the first thing I would have to answer would be "WTF is 'TITYMBW'?"

Can I be informed of updates?

Sure! This benchmark is updated whenever a new version of Squash is released, so you can just subscribe to the squash-annonce mailing list. We send one message to announce the updated version of both the library and the benchmark.

Will you add «insert compression codec»?

In order to be included the benchmark the software must be supported by Squash. If there is a specific codec you're interested in, please file an issue against Squash.

If the codec is reliable (it has to pass Squash's unit tests), works on Linux, accessible from C or C++, and open source the odds are good I would be willing to write a plugin, or at least merge a pull request.

If the codec doesn't meet all the above critera I still may be willing to accept a pull request for a plugin, but keep in mind that all the machines I run this on are running Linux with various architectures, so even if there is a plugin for a Windows-only, or x86-only, etc., library it probably will not show up for every machine. For example, I would like to add a Windows API plugin, but it will not show up on any of the Linux machines' results. Ditto for OS X.

How are the values calculated?

The benchmark collects the compressed size, compression time, and decompression time. Those are then used to calculate the values used in the benchmark:

Ratio

uncompressed size ÷ compressed size

Compression Speed

uncompressed size ÷ compression time

Decompression Speed

uncompressed size ÷ decompression time

Round Trip Speed

(2 × uncompressed size) ÷ (compression time + decompression time)

Sizes are presented using binary prefixes—1 KiB is 1024 bytes, 1 MiB is 1024 KiB, and so on.

What about memory usage?

I would really like to include that data. If you have a good way to capture that data on the C side (in benchmark.c) I would be very happy to merge it, and integrate it into the results.

Please use quixdb/squash-benchmark#2 to discuss this.

Is time CPU time or wall-clock?

CPU time. Wall-clock data is actually captured but not presented. I'm willing to consider pull requests if you can find a good way to display it, as well as a good reason.

What about multi-threading?

That's a tricky question. For one thing it would explode the number of data points (for example, LZMA would have 4 codecs with 9 levels each, multiplied the number the number of cores—that's 288 different configurations on an 8-core machine per dataset). Obviously this would make generating the benchmark even slower, but the main problem is presenting the data in a way which doesn't destroy the usability for people who are interested in single-threaded compression/decompression.

Can you switch the graphs to use a logarithmic scale?

You can. Just click on the label for either axis and it will toggle between linear and logarithmic. I know this isn't obvious—I'd be happy to merge a PR if you can improve that.

I don't want to switch the default because I think that linear is probably better for most people. Logarithmic tends to be better if all you care about is compression ratio, not speed.

Can you make it easier to compare machines or datasets (instead of codecs)?

I would like to (see quixdb/squash-benchmark-web#2 and quixdb/squash-benchmark-web#3 for discussion). It is probably going to require downloading all the data from all the machines, which is around 3.7 MiB, though HTTP compression should help (oh, the irony of being stuck with zlib).

Can you add a feature (chart, table, etc.) to the bencmark?

No promises, but I am looking for ideas—I'm certainly willing to at least listen to the request. Please file an issue.

My library isn't performing as well as I think it should!

Sorry. I am trying to keep conditions as fair and as close to real-world as I can, but I'm certainly willing to discuss any concerns you have with methodology.

The Squash library typically adds very little overhead, but if you have ideas on how to improve the plugin for your library I'm happy to accept patches.

If the issue is performance on an architecture you don't have access to (e.g., ARM), I'm willing to provide SSH access to most of the machines included in this benchmark to people working on open source libraries. If you would like access to one to help you optimize your code just let me know.

Can you add «insert machine, CPU, architecture, OS, etc.»?

Only if I have, or at least have access to, a machine which fits that description.

In general I include what I have available. That tends to be some newish Intel CPUs, some older Intel CPUs that haven't yet found their way to the electronics recycler, and some ARM SBCs. If you would like to donate other hardware I'm willing to add it to the benchmark.

What compiler flags were used?

Flags vary a bit since different plugins require different flags, but as far as performance related flags are concerned, plugins are currently compiled with -O3 -flto -march=native -mtune=native.

If you are the author of one of the libraries and would like for your plugin to use different flags when compiled as part of Squash, please file an issue. As long as the flags are safe, we will respect your wishes.

This doesn't work in my browser.

I'm sorry, but if you're using an old browser (probably Internet Explorer) you'll have to upgrade. I'm willing to consider patches, but I will not be putting in any effort to make this page display in older browsers unless someone wants to pay me to do it—and it's not something I enjoy, so they would have to pay pretty well.

If your browser is up to date, make sure JavaScript is enabled. Cookies, Flash, etc. aren't necessary, but JS definitely is.

Are there any better benchmarks?

There are different benchmarks, which may or may not be better, depending on what you're interested in. Most benchmarks use command line programs instead of libraries, which is a bit easier so they tend to include many more codecs, but usually don't include nearly as many different machines. Those benchmarks include:

The only other benchmark I'm aware of focusing on libraries is fsbench. It includes more compression codecs (though fewer total options), as well as hash functions (cryptographic and non-cryptographic) and some other cryptographic functions. It is run on a few different machines against a tarball of Silesa with all files truncated to 1 MiB.

If I'm missing any modern, up-to-date benchmarks please let me know.

Can I have the raw data?

Of course! The table in the "choose a machine" section includes a link to a CSV which you can import into your favorite spreadsheet application (or at least your least-hated spreadsheet application). If you don't have one yet, LibreOffice Calc is a good choice.

Additionally, you can grab a copy from the the data folder of the squash-benchmark-web git repository.

If you do something interesting with it please let us know! Or, even better, submit a pull request so everyone can benefit from your brilliance!

The data itself is CC0 licensed. That said, we would certainly appreciate attribution.

Can I link to a specific configuration?

Some things can be configured by passing parameters in the query string:

dataset
Dataset to show (currently xargs.1), the default is selected randomly
machine
Machine to show (currently phalanx), the default is selected randomly
speed
Transfer speed (in KiB/s) for the Transfer + Processing chart (currently 128000)
speed-scale
The default scale for the speed axis of charts (linear or logarithmic, currently linear)
visible-plugins
A comma-separated list of plugins to show in the scatter plots. All other plugins will be disabled, though they can be re-enabled by clicking on their entry in the legend.
hidden-plugins
A comma-separated list of plugins to hide in the scatter plots. Note that, if used, this parameter overrides visible-plugins

For example, your current configuration would be: https://quixdb.github.io/squash-benchmark/?dataset=xargs.1&machine=phalanx&speed=128000&speed-scale=linear.

Note that all fields are optional; you can provide as many or few of them as you like. Also, please be aware that this isn't necessarily stable—we may change the format when adding new features to the benchmark.

Discussion