Home

Awesome

Introduction

lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors. It joins all compressors into a single exe. At the beginning an input file is read to memory. Then all compressors are used to compress and decompress the file and decompressed file is verified. This approach has a big advantage of using the same compiler with the same optimizations for all compressors. The disadvantage is that it requires source code of each compressor (therefore Slug or lzturbo are not included).

Status
Build Status Build status

Usage

usage: lzbench [options] input [input2] [input3]

where [input] is a file or a directory and [options] are:
 -b#   set block/chunk size to # KB (default = MIN(filesize,1747626 KB))
 -c#   sort results by column # (1=algname, 2=ctime, 3=dtime, 4=comprsize)
 -e#   #=compressors separated by '/' with parameters specified after ',' (deflt=fast)
 -iX,Y set min. number of compression and decompression iterations (default = 1, 1)
 -j    join files in memory but compress them independently (for many small files)
 -l    list of available compressors and aliases
 -m#   set memory limit to # MB (default = no limit)
 -o#   output text format 1=Markdown, 2=text, 3=text+origSize, 4=CSV (default = 2)
 -p#   print time for all iterations: 1=fastest 2=average 3=median (default = 1)
 -r    operate recursively on directories
 -s#   use only compressors with compression speed over # MB (default = 0 MB)
 -tX,Y set min. time in seconds for compression and decompression (default = 1, 2)
 -v    disable progress information
 -x    disable real-time process priority
 -z    show (de)compression times instead of speed

Example usage:
  lzbench -ezstd filename = selects all levels of zstd
  lzbench -ebrotli,2,5/zstd filename = selects levels 2 & 5 of brotli and zstd
  lzbench -t3 -u5 fname = 3 sec compression and 5 sec decompression loops
  lzbench -t0 -u0 -i3 -j5 -ezstd fname = 3 compression and 5 decompression iter.
  lzbench -t0u0i3j5 -ezstd fname = the same as above with aggregated parameters

Compilation

For Linux/MacOS/MinGW (Windows):

make

For 32-bit compilation:

make BUILD_ARCH=32-bit

The default linking for Linux is dynamic and static for Windows. This can be changed with make BUILD_STATIC=0/1.

To remove one of compressors you can add -DBENCH_REMOVE_XXX to DEFINES in Makefile (e.g. DEFINES += -DBENCH_REMOVE_LZ4 to remove LZ4). You also have to remove corresponding *.o files (e.g. lz4/lz4.o and lz4/lz4hc.o).

lzbench was tested with:

Supported compressors

Warning: some of the compressors listed here have security issues and/or are no longer maintained. For information about the security of the various compressors, see the CompFuzz Results page.

CUDA support

If CUDA is available, lzbench supports additional compressors:

The directory where the CUDA compiler and libraries are available can be passed to make via the CUDA_BASE variable, e.g.:

make CUDA_BASE=/usr/local/cuda

Benchmarks

The following results are obtained with lzbench 1.8 with the -t16,16 -eall options using 1 core of Intel Core i7-8700K, Ubuntu 18.04.3 64-bit, and clang 9.0.1 with "silesia.tar" which contains tarred files from Silesia compression corpus. The results sorted by ratio are available here.

Compressor nameCompress.Decompress.Compr. sizeRatio
memcpy10362 MB/s10790 MB/s211947520100.00
blosclz 2.0.0 -16485 MB/s7959 MB/s211947520100.00
blosclz 2.0.0 -31073 MB/s5909 MB/s19943733094.10
blosclz 2.0.0 -6412 MB/s1083 MB/s13757176564.91
blosclz 2.0.0 -9403 MB/s1037 MB/s13555785063.96
brieflz 1.2.0 -1197 MB/s431 MB/s8113880338.28
brieflz 1.2.0 -3108 MB/s436 MB/s7555073635.65
brieflz 1.2.0 -619 MB/s468 MB/s6720842031.71
brieflz 1.2.0 -80.46 MB/s473 MB/s6491213930.63
brotli 2019-10-01 -0420 MB/s419 MB/s7843329837.01
brotli 2019-10-01 -2154 MB/s485 MB/s6806068632.11
brotli 2019-10-01 -535 MB/s520 MB/s5956860328.11
brotli 2019-10-01 -810 MB/s533 MB/s5714016826.96
brotli 2019-10-01 -110.63 MB/s451 MB/s5041240423.79
bzip2 1.0.8 -118 MB/s52 MB/s6048481328.54
bzip2 1.0.8 -516 MB/s44 MB/s5572439526.29
bzip2 1.0.8 -915 MB/s41 MB/s5457281125.75
crush 1.0 -053 MB/s413 MB/s7306460334.47
crush 1.0 -16.11 MB/s455 MB/s6649441231.37
crush 1.0 -20.82 MB/s468 MB/s6374622330.08
csc 2016-10-13 -121 MB/s73 MB/s5620109226.52
csc 2016-10-13 -39.38 MB/s71 MB/s5347791425.23
csc 2016-10-13 -53.86 MB/s77 MB/s4980157723.50
density 0.14.2 -12214 MB/s2677 MB/s13304216662.77
density 0.14.2 -2933 MB/s1433 MB/s10165144447.96
density 0.14.2 -3432 MB/s529 MB/s8764986641.35
fastlz 0.1 -1341 MB/s806 MB/s10462808449.37
fastlz 0.1 -2368 MB/s811 MB/s10090607247.61
fastlzma2 1.0.1 -123 MB/s90 MB/s5903095427.85
fastlzma2 1.0.1 -311 MB/s94 MB/s5402383725.49
fastlzma2 1.0.1 -57.44 MB/s103 MB/s5120957124.16
fastlzma2 1.0.1 -85.18 MB/s103 MB/s4912674023.18
fastlzma2 1.0.1 -103.99 MB/s105 MB/s4866606522.96
gipfeli 2016-07-13403 MB/s663 MB/s8793175941.49
libdeflate 1.3 -1201 MB/s865 MB/s7331837134.59
libdeflate 1.3 -3161 MB/s912 MB/s7066896833.34
libdeflate 1.3 -699 MB/s924 MB/s6792818932.05
libdeflate 1.3 -916 MB/s898 MB/s6570153931.00
libdeflate 1.3 -127.39 MB/s900 MB/s6480162930.57
lizard 1.0 -10635 MB/s4173 MB/s10340297148.79
lizard 1.0 -12179 MB/s3955 MB/s8623242240.69
lizard 1.0 -1585 MB/s4081 MB/s8118733038.31
lizard 1.0 -194.60 MB/s4043 MB/s7741640036.53
lizard 1.0 -20481 MB/s2985 MB/s9692420445.73
lizard 1.0 -22149 MB/s2904 MB/s8486672540.04
lizard 1.0 -2518 MB/s2853 MB/s7586791535.80
lizard 1.0 -292.07 MB/s2697 MB/s6869422732.41
lizard 1.0 -30453 MB/s1414 MB/s8572742940.45
lizard 1.0 -32193 MB/s1641 MB/s7865265437.11
lizard 1.0 -3595 MB/s2279 MB/s7456358335.18
lizard 1.0 -394.37 MB/s2475 MB/s6980752232.94
lizard 1.0 -40354 MB/s1497 MB/s8084304938.14
lizard 1.0 -42131 MB/s1621 MB/s7335098834.61
lizard 1.0 -4517 MB/s1810 MB/s6731758831.76
lizard 1.0 -491.95 MB/s1729 MB/s6067921528.63
lz4 1.9.2737 MB/s4448 MB/s10088080047.60
lz4fast 1.9.2 -3838 MB/s4423 MB/s10706619050.52
lz4fast 1.9.2 -171201 MB/s4632 MB/s13173280262.15
lz4hc 1.9.2 -1131 MB/s4071 MB/s8380376939.54
lz4hc 1.9.2 -481 MB/s4210 MB/s7980790937.65
lz4hc 1.9.2 -933 MB/s4378 MB/s7788444836.75
lz4hc 1.9.2 -1211 MB/s4427 MB/s7726262036.45
lzf 3.6 -0400 MB/s869 MB/s10568208849.86
lzf 3.6 -1398 MB/s914 MB/s10204109248.14
lzfse 2017-03-0890 MB/s934 MB/s6762428131.91
lzg 1.0.10 -191 MB/s653 MB/s10855366751.22
lzg 1.0.10 -453 MB/s655 MB/s9593055145.26
lzg 1.0.10 -629 MB/s702 MB/s8949022042.22
lzg 1.0.10 -89.30 MB/s762 MB/s8360690139.45
lzham 1.0 -d26 -011 MB/s271 MB/s6408987030.24
lzham 1.0 -d26 -12.98 MB/s340 MB/s5474058925.83
lzjb 2010394 MB/s601 MB/s12267161357.88
lzlib 1.11 -036 MB/s61 MB/s6384738630.12
lzlib 1.11 -36.81 MB/s69 MB/s5632067426.57
lzlib 1.11 -62.82 MB/s74 MB/s4977749523.49
lzlib 1.11 -91.82 MB/s76 MB/s4829688922.79
lzma 19.00 -034 MB/s80 MB/s6401391730.20
lzma 19.00 -225 MB/s91 MB/s5886791127.77
lzma 19.00 -414 MB/s95 MB/s5720164526.99
lzma 19.00 -53.28 MB/s103 MB/s4971030723.45
lzma 19.00 -92.66 MB/s107 MB/s4870745022.98
lzmat 1.0138 MB/s479 MB/s7648535336.09
lzo1 2.10 -1308 MB/s799 MB/s10647451950.24
lzo1 2.10 -99123 MB/s857 MB/s9494612944.80
lzo1a 2.10 -1309 MB/s811 MB/s10420225149.16
lzo1a 2.10 -99121 MB/s869 MB/s9266626543.72
lzo1b 2.10 -1257 MB/s805 MB/s9703608745.78
lzo1b 2.10 -3255 MB/s821 MB/s9404457844.37
lzo1b 2.10 -6244 MB/s823 MB/s9138235543.12
lzo1b 2.10 -9186 MB/s816 MB/s8926188442.12
lzo1b 2.10 -99126 MB/s839 MB/s8565337640.41
lzo1b 2.10 -99912 MB/s945 MB/s7659429236.14
lzo1c 2.10 -1269 MB/s812 MB/s9955090446.97
lzo1c 2.10 -3262 MB/s829 MB/s9671615345.63
lzo1c 2.10 -6211 MB/s819 MB/s9330362344.02
lzo1c 2.10 -9169 MB/s820 MB/s9104038642.95
lzo1c 2.10 -99110 MB/s828 MB/s8811228841.57
lzo1c 2.10 -99924 MB/s878 MB/s8039674137.93
lzo1f 2.10 -1244 MB/s793 MB/s9974332947.06
lzo1f 2.10 -99921 MB/s833 MB/s8089020638.17
lzo1x 2.10 -1680 MB/s868 MB/s10057253747.45
lzo1x 2.10 -11735 MB/s893 MB/s10660462950.30
lzo1x 2.10 -12717 MB/s875 MB/s10323885948.71
lzo1x 2.10 -15699 MB/s871 MB/s10146209447.87
lzo1x 2.10 -9998.76 MB/s827 MB/s7530190335.53
lzo1y 2.10 -1674 MB/s863 MB/s10125831847.78
lzo1y 2.10 -9998.87 MB/s822 MB/s7550384935.62
lzo1z 2.10 -9998.67 MB/s814 MB/s7506133135.42
lzo2a 2.10 -99927 MB/s667 MB/s8280933739.07
lzrw 15-Jul-1991 -1317 MB/s646 MB/s11376162553.67
lzrw 15-Jul-1991 -3381 MB/s726 MB/s10542416849.74
lzrw 15-Jul-1991 -4392 MB/s630 MB/s10013135647.24
lzrw 15-Jul-1991 -5150 MB/s677 MB/s9081881042.85
lzsse2 2019-04-18 -124 MB/s3276 MB/s8797609541.51
lzsse2 2019-04-18 -610 MB/s3741 MB/s7583710135.78
lzsse2 2019-04-18 -129.74 MB/s3754 MB/s7582997335.78
lzsse2 2019-04-18 -169.82 MB/s3762 MB/s7582997335.78
lzsse4 2019-04-18 -121 MB/s3965 MB/s8254210638.94
lzsse4 2019-04-18 -610 MB/s4272 MB/s7611829835.91
lzsse4 2019-04-18 -1210 MB/s4272 MB/s7611301735.91
lzsse4 2019-04-18 -1610 MB/s4291 MB/s7611301735.91
lzsse8 2019-04-18 -119 MB/s4166 MB/s8186624538.63
lzsse8 2019-04-18 -610 MB/s4503 MB/s7546971735.61
lzsse8 2019-04-18 -129.86 MB/s4491 MB/s7546433935.61
lzsse8 2019-04-18 -169.90 MB/s4461 MB/s7546433935.61
lzvn 2017-03-0873 MB/s1223 MB/s8081460938.13
pithy 2011-12-24 -0647 MB/s2084 MB/s10307246348.63
pithy 2011-12-24 -3597 MB/s2083 MB/s9725518645.89
pithy 2011-12-24 -6483 MB/s2221 MB/s9209089843.45
pithy 2011-12-24 -9400 MB/s2256 MB/s9036081342.63
quicklz 1.5.0 -1550 MB/s715 MB/s9472056244.69
quicklz 1.5.0 -2286 MB/s708 MB/s8455562739.89
quicklz 1.5.0 -359 MB/s1069 MB/s8182224138.60
shrinker 0.1985 MB/s3180 MB/s17253577881.40
slz_zlib 1.0.0 -1301 MB/s380 MB/s9965795847.02
slz_zlib 1.0.0 -2297 MB/s378 MB/s9686309445.70
slz_zlib 1.0.0 -3293 MB/s379 MB/s9618778045.38
snappy 2019-09-30591 MB/s1868 MB/s10214676748.19
tornado 0.6a -1437 MB/s520 MB/s10738184650.66
tornado 0.6a -2300 MB/s488 MB/s9007666042.50
tornado 0.6a -3186 MB/s301 MB/s7266204434.28
tornado 0.6a -4133 MB/s310 MB/s7051361733.27
tornado 0.6a -551 MB/s195 MB/s6412960430.26
tornado 0.6a -634 MB/s195 MB/s6236458329.42
tornado 0.6a -716 MB/s194 MB/s5902632527.85
tornado 0.6a -105.73 MB/s192 MB/s5758824127.17
tornado 0.6a -136.94 MB/s202 MB/s5561407226.24
tornado 0.6a -162.15 MB/s207 MB/s5325704625.13
ucl_nrv2b 1.03 -158 MB/s322 MB/s8170316838.55
ucl_nrv2b 1.03 -620 MB/s375 MB/s7390218534.87
ucl_nrv2b 1.03 -92.09 MB/s407 MB/s7103119533.51
ucl_nrv2d 1.03 -159 MB/s333 MB/s8146197638.43
ucl_nrv2d 1.03 -621 MB/s386 MB/s7375767334.80
ucl_nrv2d 1.03 -92.09 MB/s422 MB/s7005389533.05
ucl_nrv2e 1.03 -159 MB/s330 MB/s8119556038.31
ucl_nrv2e 1.03 -621 MB/s391 MB/s7330201234.58
ucl_nrv2e 1.03 -92.13 MB/s429 MB/s6964513432.86
wflz 2015-09-16305 MB/s1183 MB/s10960526451.71
xpack 2016-06-02 -1171 MB/s890 MB/s7109006533.54
xpack 2016-06-02 -643 MB/s1086 MB/s6221384529.35
xpack 2016-06-02 -917 MB/s1116 MB/s6124092828.89
xz 5.2.4 -024 MB/s70 MB/s6257943529.53
xz 5.2.4 -36.76 MB/s84 MB/s5574512526.30
xz 5.2.4 -62.95 MB/s89 MB/s4919592923.21
xz 5.2.4 -92.62 MB/s88 MB/s4874530623.00
yalz77 2015-09-19 -1105 MB/s578 MB/s9395272844.33
yalz77 2015-09-19 -456 MB/s539 MB/s8739263241.23
yalz77 2015-09-19 -835 MB/s532 MB/s8515328740.18
yalz77 2015-09-19 -1224 MB/s518 MB/s8405062539.66
yappy 2014-03-22 -1165 MB/s2809 MB/s10575095649.89
yappy 2014-03-22 -10128 MB/s2969 MB/s10001867347.19
yappy 2014-03-22 -10096 MB/s3001 MB/s9867251446.56
zlib 1.2.11 -1119 MB/s383 MB/s7725902936.45
zlib 1.2.11 -635 MB/s407 MB/s6822843132.19
zlib 1.2.11 -914 MB/s404 MB/s6764454831.92
zling 2018-10-12 -075 MB/s216 MB/s6299059029.72
zling 2018-10-12 -167 MB/s221 MB/s6202254629.26
zling 2018-10-12 -260 MB/s225 MB/s6150309329.02
zling 2018-10-12 -353 MB/s226 MB/s6099982828.78
zling 2018-10-12 -446 MB/s226 MB/s6062676828.60
zstd 1.4.3 -1480 MB/s1203 MB/s7350882334.68
zstd 1.4.3 -2356 MB/s1067 MB/s6959451132.84
zstd 1.4.3 -5104 MB/s932 MB/s6399374730.19
zstd 1.4.3 -846 MB/s1055 MB/s6075779328.67
zstd 1.4.3 -1120 MB/s1001 MB/s5923935727.95
zstd 1.4.3 -157.12 MB/s1024 MB/s5716742226.97
zstd 1.4.3 -183.58 MB/s912 MB/s5369057225.33
zstd 1.4.3 -222.28 MB/s865 MB/s5273831224.88