README.md

January 26, 2025 ยท View on GitHub

Lizard - efficient compression with very fast decompression

Lizard (formerly LZ5) is a lossless compression algorithm which contains 4 compression methods:

  • fastLZ4 : compression levels -10...-19 are designed to give fast decompression speed
  • LIZv1 : compression levels -20...-29 are designed to give better compression ratio keeping 75% of decompression speed
  • fastLZ4 + Huffman : compression levels -30...-39 add Huffman coding to fastLZ4
  • LIZv1 + Huffman : compression levels -40...-49 give the best ratio (comparable to zlib and low levels of zstd/brotli)

Lizard library is based on frequently used LZ4 library by Yann Collet but the Lizard compression format is not compatible with LZ4. Lizard library is provided as open-source software using BSD 2-Clause license. The high compression/decompression speed is achieved without any SSE and AVX extensions.

Status
Build Status

2025 Update

Back in 2017, Lizard 1.0 filled a niche between LZ4 and zstd in terms of compression ratio, as well as compression and decompression speed. However, based on benchmarks conducted in 2025 (shared below), both LZ4 and zstd have made substantial advancements, particularly in compression and decompression speed, leaving Lizard outdated and effectively obsolete.

Benchmarks

The following results were obtained using lzbench 2.0, built with gcc 14.2.0 and executed with the options -t16,16 -o1c4 -elz4/lz4hc/lizard/zstd_fast/zstd/zlib/brotli. The tests were run on a single core of an AMD EPYC 9554 processor at 3.10 GHz, with the CPU governor set to performance and turbo boost disabled for stability. The operating system was Ubuntu 24.04.1, and the benchmark made use of silesia.tar, which contains tarred files from the Silesia compression corpus.

Compressor nameCompressionDecompress.Compr. sizeRatio
memcpy16253 MB/s16151 MB/s211947520100.00
lz4 1.10.0579 MB/s3728 MB/s10088080047.60
lz4hc 1.10.0 -1265 MB/s3225 MB/s8913542942.06
lz4hc 1.10.0 -2265 MB/s3227 MB/s8913542942.06
lz4hc 1.10.0 -392.7 MB/s3373 MB/s8134242138.38
lz4hc 1.10.0 -476.6 MB/s3429 MB/s7980790937.65
lz4hc 1.10.0 -562.6 MB/s3474 MB/s7889532937.22
lz4hc 1.10.0 -651.4 MB/s3494 MB/s7838570836.98
lz4hc 1.10.0 -742.7 MB/s3511 MB/s7810245236.85
lz4hc 1.10.0 -836.1 MB/s3525 MB/s7795747936.78
lz4hc 1.10.0 -931.0 MB/s3531 MB/s7788444836.75
lz4hc 1.10.0 -1021.4 MB/s3604 MB/s7759676636.61
lz4hc 1.10.0 -1112.5 MB/s3630 MB/s7731548036.48
lz4hc 1.10.0 -1210.5 MB/s3622 MB/s7726262036.45
lizard 2.1 -10484 MB/s2161 MB/s10340297148.79
lizard 2.1 -11316 MB/s1935 MB/s9386162144.29
lizard 2.1 -12166 MB/s2005 MB/s8623242240.69
lizard 2.1 -13102 MB/s2040 MB/s8377311939.53
lizard 2.1 -1490.3 MB/s2082 MB/s8220597638.79
lizard 2.1 -1577.8 MB/s2106 MB/s8118733038.31
lizard 2.1 -1656.0 MB/s1951 MB/s7937251237.45
lizard 2.1 -1726.5 MB/s1986 MB/s7804171436.82
lizard 2.1 -186.67 MB/s1978 MB/s7758698436.61
lizard 2.1 -194.81 MB/s1989 MB/s7741640036.53
lizard 2.1 -20388 MB/s1674 MB/s9692420445.73
lizard 2.1 -21229 MB/s1748 MB/s8923917442.10
lizard 2.1 -22162 MB/s1709 MB/s8486672540.04
lizard 2.1 -2364.5 MB/s1769 MB/s8105220938.24
lizard 2.1 -2436.8 MB/s1792 MB/s7817087536.88
lizard 2.1 -2522.3 MB/s1748 MB/s7513128635.45
lizard 2.1 -266.33 MB/s1767 MB/s7245916134.19
lizard 2.1 -274.46 MB/s1813 MB/s7044761533.24
lizard 2.1 -282.43 MB/s1821 MB/s6976297232.92
lizard 2.1 -292.13 MB/s1818 MB/s6869422732.41
lizard 2.1 -30363 MB/s1185 MB/s8572742940.45
lizard 2.1 -31263 MB/s1325 MB/s8168852238.54
lizard 2.1 -32164 MB/s1274 MB/s7865265437.11
lizard 2.1 -33151 MB/s1410 MB/s7692945436.30
lizard 2.1 -3496.6 MB/s1477 MB/s7542793035.59
lizard 2.1 -3585.7 MB/s1542 MB/s7456358335.18
lizard 2.1 -3674.7 MB/s1573 MB/s7385040034.84
lizard 2.1 -3754.5 MB/s1521 MB/s7185474333.90
lizard 2.1 -3826.2 MB/s1565 MB/s7096868633.48
lizard 2.1 -394.66 MB/s1509 MB/s6980752232.94
lizard 2.1 -40297 MB/s1141 MB/s8084304938.14
lizard 2.1 -41192 MB/s1202 MB/s7610066135.91
lizard 2.1 -42142 MB/s1231 MB/s7335098834.61
lizard 2.1 -4359.7 MB/s1325 MB/s7092785833.46
lizard 2.1 -4434.4 MB/s1353 MB/s6876351232.44
lizard 2.1 -4521.7 MB/s1345 MB/s6667665331.46
lizard 2.1 -4611.4 MB/s1201 MB/s6541306130.86
lizard 2.1 -476.07 MB/s1271 MB/s6370414630.06
lizard 2.1 -484.31 MB/s1297 MB/s6209796529.30
lizard 2.1 -492.08 MB/s1316 MB/s6067921528.63
zstd_fast 1.5.6 --5573 MB/s1948 MB/s10309375248.64
zstd_fast 1.5.6 --4542 MB/s1905 MB/s9882526746.63
zstd_fast 1.5.6 --3518 MB/s1818 MB/s9467467244.67
zstd_fast 1.5.6 --2489 MB/s1773 MB/s9047435842.69
zstd_fast 1.5.6 --1459 MB/s1716 MB/s8698400941.04
zstd 1.5.6 -1421 MB/s1342 MB/s7342191434.64
zstd 1.5.6 -2344 MB/s1241 MB/s6950344432.79
zstd 1.5.6 -3250 MB/s1210 MB/s6652384231.39
zstd 1.5.6 -4214 MB/s1192 MB/s6532363730.82
zstd 1.5.6 -5125 MB/s1194 MB/s6304031029.74
zstd 1.5.6 -691.7 MB/s1272 MB/s6154042629.04
zstd 1.5.6 -780.7 MB/s1283 MB/s6054655828.57
zstd 1.5.6 -864.1 MB/s1316 MB/s6001506428.32
zstd 1.5.6 -961.9 MB/s1306 MB/s5937534428.01
zstd 1.5.6 -1048.0 MB/s1323 MB/s5867546427.68
zstd 1.5.6 -1134.5 MB/s1339 MB/s5826229927.49
zstd 1.5.6 -1231.8 MB/s1339 MB/s5820698227.46
zstd 1.5.6 -1314.2 MB/s1343 MB/s5798655027.36
zstd 1.5.6 -1411.3 MB/s1360 MB/s5757572327.17
zstd 1.5.6 -158.39 MB/s1368 MB/s5716883426.97
zstd 1.5.6 -166.13 MB/s1255 MB/s5530478926.09
zstd 1.5.6 -174.76 MB/s1226 MB/s5424333925.59
zstd 1.5.6 -183.76 MB/s1164 MB/s5332987325.16
zstd 1.5.6 -192.98 MB/s1147 MB/s5287511624.95
zstd 1.5.6 -202.73 MB/s1079 MB/s5245674324.75
zstd 1.5.6 -212.40 MB/s1075 MB/s5234420324.70
zstd 1.5.6 -222.09 MB/s1071 MB/s5233388024.69
zlib 1.3.1 -193.2 MB/s323 MB/s7725902936.45
zlib 1.3.1 -283.4 MB/s333 MB/s7500227735.39
zlib 1.3.1 -360.3 MB/s344 MB/s7296704034.43
zlib 1.3.1 -458.4 MB/s334 MB/s7100281733.50
zlib 1.3.1 -539.2 MB/s337 MB/s6916168532.63
zlib 1.3.1 -625.3 MB/s344 MB/s6822843132.19
zlib 1.3.1 -720.3 MB/s345 MB/s6793964732.05
zlib 1.3.1 -813.1 MB/s347 MB/s6769342731.94
zlib 1.3.1 -910.3 MB/s348 MB/s6764454831.92
brotli 1.1.0 -0341 MB/s352 MB/s7843329837.01
brotli 1.1.0 -1234 MB/s379 MB/s7349922234.68
brotli 1.1.0 -2139 MB/s415 MB/s6806948932.12
brotli 1.1.0 -3116 MB/s429 MB/s6739249231.80
brotli 1.1.0 -480.3 MB/s452 MB/s6412298930.25
brotli 1.1.0 -536.9 MB/s450 MB/s5955544628.10
brotli 1.1.0 -626.9 MB/s457 MB/s5847046527.59
brotli 1.1.0 -717.5 MB/s472 MB/s5768819127.22
brotli 1.1.0 -812.4 MB/s476 MB/s5714830426.96
brotli 1.1.0 -99.19 MB/s480 MB/s5670394626.75
brotli 1.1.0 -101.25 MB/s345 MB/s5172080024.40
brotli 1.1.0 -110.58 MB/s387 MB/s5040779523.78

Automatic CI/CD testing

lizard undergoes automated testing using Azure Pipelines with the following compilers:

  • Ubuntu: gcc (versions 7.5 to 14.2) and clang (versions 6.0 to 19), gcc 14.2 (32-bit)
  • MacOS: Apple LLVM version 15.0.0
  • Windows: mingw32-gcc 14.2.0 (32-bit) and mingw64-gcc 14.2.0 (64-bit)
  • Cross-compilation: gcc for ARM (32-bit and 64-bit) and PowerPC (32-bit and 64-bit)
  • Visual Studio 2019 / 2022 (32-bit and 64-bit)

Documentation

The raw Lizard block compression format is detailed within lizard_Block_format.

To compress an arbitrarily long file or data stream, multiple blocks are required. Organizing these blocks and providing a common header format to handle their content is the purpose of the Frame format, defined into lizard_Frame_format. Interoperable versions of Lizard must respect this frame format.