Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

lzbench

> 编程语言
Open source

lzbench is an in-memory benchmark of open-source compressors

1.1K stars0 likes0 views
WebsiteGitHub

About

lzbench is an in-memory benchmark of open-source compressors

Introduction

lzbench is an in-memory benchmarking tool for open-source compressors. It integrates all compressors into a single executable. Initially, an input file is loaded into memory, after which each compressor is used to compress and decompress the file, ensuring the decompressed output matches the original. This method provides the advantage of compiling all compressors with the same compiler and optimizations. However, it requires access to the source code of each compressor, meaning e.g. Slug and lzturbo are not included.

Status
Build Status

The list of changes in lzbench is available in the CHANGELOG.

Contributor information can be found in CONTRIBUTING.md.

Usage

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

For example:
  lzbench -ezstd filename = selects all levels of zstd
  lzbench -ebrotli,2,5/zstd filename = selects levels 2 & 5 of brotli and zstd
  lzbench -t3,5 fname = 3 sec compression and 5 sec decompression loops
  lzbench -t0,0 -i3,5 fname = 3 compression and 5 decompression iterations
  lzbench -o1c4 fname = output markdown format and sort by 4th column
  lzbench -ezlib -j -r dirname/ = test zlib on all files in directory, recursively

For complete list of options refer to manual in doc directory which contains more detailed documentation.

Building

To compile, you need a C and C++ compiler that is GNUC-compatible, such as GCC, LLVM/Clang, or ICC. It is recommended to use GCC 7.1+ or Clang 6.0+.

For Linux/MacOS/MinGW (Windows):

make -j$(nproc)

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

For complete building instruction, with troubleshooting refer to BUILD.md.

Supported compressors

The table below lists the supported compressors. The Last update column is the release date of the bundled version. Compressors are built on every CI platform (Linux x86-64/x86-32/ARM64/ARM32/PPC64LE, macOS arm64, Windows MinGW) unless the Notes column says otherwise. Where lzbench carries local build fixes to a codec's sources, the Notes column says so.

Compressor Last update Notes
aceapex 1.0.1 2026-07-30
brieflz 1.3.0 2020-02-15
brotli 1.2.0 2025-10-27
bsc 3.3.12 2025-09-10 Disabled on 32-bit ARM — multithreaded decompress faults (SIGBUS, lzbench#293)
bzip2 1.0.8 2019-07-13
bzip3 1.5.3 2025-08-13
crush 1.0 2013-07-01
density 0.16.6 2025-08-27 Linux x86-64 and macOS only — requires the Rust toolchain (skipped for 32-bit, cross-compiled and Windows builds)
fastlz 0.5.0 2020-02-02
fast-lzma2 1.0.1 2019-05-06
glza 0.12 2026-03-23
gpucompact 1.1 2026-08-14 CUDA only
kanzi 2.5.3 2026-04-22
lbzip2 2.6.5 2026-08-18 bzip2 format; benchmarked single-threaded
libdeflate v1.25 2025-11-01
lizard v2.1 2025-01-26
lz4/lz4hc v1.10.0 2024-07-21
lzav 5.16 2026-07-21
lzf 3.6 2014-03-13
lzfse/lzvn 1.0 2017-03-08
lzg 1.0.10 2018-11-29
lzham 1.0 2020-09-15 Public domain since 2020-09-15. Build fixed in lzbench for MinGW and newer compilers (`` includes, GetSystemInfo, DISABLE_THREADING). Disabled on macOS and 32-bit x86 — 64 MB dictionary overflows the 32-bit address space
lzjb 2010 2010
lzlib 1.16 2026-03-11
lzma v26.01 2026-04-27
lzo 2.10 2017-03-01
lzsse 2019-04-18 (1847c3e827) 2019-04-18 64-bit x86 only — requires SSE4.1 (Windows: MinGW-w64 only); lzsse8fast has a bug
memlz 0.2 beta 2025-11-03 Disabled on 32-bit ARM — unaligned access faults (SIGBUS)
misa77 0.6.0 2026-07-30 Little-endian 64-bit only — needs a C++20 compiler (GCC 10+, Clang 12+); skipped automatically
nvcomp 2.2.0 2022-02-07 CUDA only — built with make ENABLE_CUDA=1; not in the default CI matrix
openzl 0.2.3 2026-07-28 64-bit only — upstream does not support 32-bit builds
ppmd8 26.01 2026-04-27
quicklz 1.5.1 beta 7 2011-10-07
skim 0.1.0 2026-06-07 Linux x86-64 and macOS only — requires the Zig compiler
slz 1.2.2 2026-04-09 Compressor only; decompresses via zlib
snappy 1.2.2 2025-03-26 Patched in lzbench: RISC-V support in snappy-internal.h
tamp 2.2.4 2026-06-11
tornado 0.6a 2014-03-08 Disabled on RISC-V (unaligned access)
ucl 1.03 2004-07-20
xz 5.8.3 2026-03-31 Built in lzbench with a hand-written config.h (upstream uses autotools)
yalz77 2022-07-06 2022-07-06
zlib 1.3.2 2026-02-17
zlib-ng 2.3.3 2026-02-03
zling 2018-10-12 2018-10-12 Build fixed in lzbench (missing `` include). Disabled on big-endian PowerPC; not recommended for production use (per author)
zpaq 7.15 2016-08-17 Slower on non-x86 — built with -DNOJIT (x86-only JIT, portable interpreter elsewhere)
zstd 1.5.7 2025-02-19
zxc 0.14.0 2026-09-03

Warning: The compressors listed below have security issues and/or are no longer maintained.

Compressor Last update Notes
csc 2016-10-13 2016-10-13 Build fixed in lzbench (SSE intrinsics header, 7-Zip type guards). Disabled on macOS — segfaults with Apple LLVM 7.3.0 (clang-703.0.31)
gipfeli 2016-07-13 2016-07-13 Decompression file mismatch when compiled with GCC 14.2 using -O3
lzmat 1.01 v1.0 2008-07-08 Build fixed in lzbench for 64-bit (pointer arithmetic truncated through MP_U32). Decompression bugs; may segfault with GCC 4.9+ using -O3
lzrw 15-Jul-1991 1991-07-15 May segfault with GCC 4.9+ using -O3
wflz 2015-09-16 2015-09-16 May segfault with GCC 4.9+ using -O3
yappy 2014-03-22 2014-03-22 Disabled on big-endian PowerPC; segfault with GCC 13.3.0 on 32-bit ARM (arm-linux-gnueabi)

Benchmarks

The following results were obtained using lzbench 2.0.1, built with gcc 14.2.0 and executed with the options -eALL -t8,8 -o1c4. The tests were run on a single thread 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.

The results sorted by ratio are available here.

Compressor name Compression Decompress. Compr. size Ratio
memcpy 16332 MB/s 16362 MB/s 211947520 100.00
brieflz 1.3.0 -1 199 MB/s 354 MB/s 81138803 38.28
brieflz 1.3.0 -3 132 MB/s 364 MB/s 75550736 35.65
brieflz 1.3.0 -6 21.0 MB/s 395 MB/s 67208420 31.71
brieflz 1.3.0 -8 2.84 MB/s 419 MB/s 64531718 30.45
brotli 1.1.0 -0 341 MB/s 352 MB/s 78433298 37.01
brotli 1.1.0 -2 140 MB/s 413 MB/s 68069489 32.12
brotli 1.1.0 -5 37.1 MB/s 451 MB/s 59555446 28.10
brotli 1.1.0 -8 12.3 MB/s 477 MB/s 57148304 26.96
brotli 1.1.0 -11 0.58 MB/s 389 MB/s 50407795 23.78
bsc 3.3.5 -m0 -e1 16.6 MB/s 24.1 MB/s 49143366 23.19
bsc 3.3.5 -m4 -e1 31.2 MB/s 14.3 MB/s 50626974 23.89
bsc 3.3.5 -m5 -e1 28.8 MB/s 13.3 MB/s 49522504 23.37
bzip2 1.0.8 -1 14.8 MB/s 46.6 MB/s 60484813 28.54
bzip2 1.0.8 -5 14.0 MB/s 40.0 MB/s 55724395 26.29
bzip2 1.0.8 -9 13.1 MB/s 37.5 MB/s 54572811 25.75
crush 1.0 -0 64.3 MB/s 357 MB/s 73064603 34.47
crush 1.0 -1 6.95 MB/s 407 MB/s 66494412 31.37
crush 1.0 -2 0.91 MB/s 421 MB/s 63746223 30.08
fastlz 0.5.0 -1 285 MB/s 710 MB/s 104628084 49.37
fastlz 0.5.0 -2 293 MB/s 699 MB/s 100906072 47.61
fastlzma2 1.0.1 -1 21.9 MB/s 75.8 MB/s 59030950 27.85
fastlzma2 1.0.1 -3 12.1 MB/s 81.4 MB/s 54023833 25.49
fastlzma2 1.0.1 -5 7.31 MB/s 87.6 MB/s 51209567 24.16
fastlzma2 1.0.1 -8 4.46 MB/s 89.7 MB/s 49126736 23.18
fastlzma2 1.0.1 -10 3.31 MB/s 90.2 MB/s 48666061 22.96
kanzi 2.3 -2 155 MB/s 432 MB/s 68264304 32.21
kanzi 2.3 -3 106 MB/s 321 MB/s 64963864 30.65
kanzi 2.3 -4 53.7 MB/s 152 MB/s 60767201 28.67
kanzi 2.3 -5 21.0 MB/s 50.3 MB/s 54050463 25.50
kanzi 2.3 -6 15.8 MB/s 29.6 MB/s 49517568 23.36
kanzi 2.3 -7 10.2 MB/s 15.2 MB/s 47308205 22.32
kanzi 2.3 -8 3.45 MB/s 3.29 MB/s 43247149 20.40
kanzi 2.3 -9 2.44 MB/s 2.35 MB/s 41807652 19.73
libdeflate 1.23 -1 207 MB/s 860 MB/s 73502791 34.68

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Cbenchmarkbenchmarkingbrotlicompression

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言