bzip3

Sep 07, 2026 08:35 PM - 1 hour ago 2

Build

A better, faster and stronger belief successor to BZip2. Features higher compression ratios and amended capacity acknowledgment to a order-0 discourse mixing entropy coder, a accelerated Burrows-Wheeler toggle shape codification making usage of suffix arrays and a RLE pinch Lempel Ziv+Prediction walk based connected LZ77-style drawstring matching and PPM-style discourse modeling.

Like its ancestor, BZip3 excels astatine compressing matter aliases code.

# If utilizing a git clone (not needed for source packages), first... $ ./bootstrap.sh # All... $ ./configure $ make $ sudo make install

Alternatively, you mightiness beryllium capable to instal bzip3 utilizing your system's package manager:

Packaging status

On macOS, you tin usage Homebrew to easy install:

Perl root codification benchmark

First, I person downloaded each type of Perl5 ever released and decompressed them.

% wget -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories https://www.cpan.org/src/5.0/ % for g in *.gz; do gunzip $g; done % ls -la | wc -l 262

Then, I put each the resulting .tar files successful a azygous .tar record and tried to compress it utilizing various compressors:

xz -T16 -9 -k all.tar 10829.91s personification 26.91s strategy 1488% cpu 14658M representation 12:09.24 total bzip2 -9 -k all.tar 981.78s personification 9.77s strategy 95% cpu 8M representation 17:16.64 total bzip3 -e -b 256 -j 12 all.tar 2713.81s personification 16.28s strategy 634% cpu 18301M representation 7:10.10 total bzip3 -e -b 511 -j 4 all.tar 17.65s personification 12.19s strategy 170% cpu 12178M representation 7:08.65 total zstd -T12 -16 all.tar 4162.94s personification 16.40s strategy 1056% cpu 687M representation 6:35.62 total

The results follow:

Method Compressed size (bytes)
LZMA (xz) 2'056'645'240
bzip2 3'441'163'911
bzip3 -b 256 1'001'957'587
bzip3 -b 511 546'456'978
Zstandard 3'076'143'660

Finally, wall timepiece clip decompression times (WD Blue HDD):

Method Decompression time
LZMA (xz) 4min 40s
bzip2 9min 22s
bzip3 (parallel) 4min 06s
Zstandard 3min 51s

Then, I utilized lrzip to execute long-range deduplication connected the original .tar file:

% clip lrzip -n -o all_none.tar.lrz all.tar 546.17s personification 160.87s strategy 102% cpu 10970M representation 11:28.00 total % clip lrzip --lzma -o all_lzma.tar.lrz all.tar 702.16s personification 161.87s strategy 122% cpu 10792M representation 11:44.83 total % clip lrzip -b -o all_bzip2.tar.lrz all.tar 563.93s personification 147.38s strategy 112% cpu 10970M representation 10:34.10 total

Finally, I compressed the resulting none.tar.lrz record utilizing bzip3:

% clip bzip3 -e -b 256 -j 2 all_none.tar.lrz 32.05s personification 0.76s strategy 146% cpu 2751M representation 22.411 total

The results follow:

Method Compressed size (bytes)
lrzip + bzip3 60'672'608
lrzip + lzma 64'774'202
lrzip + bzip2 75'685'065

For further benchmarks against Turbo-Range-Coder and BSC, cheque powturbo's benchmark of bzip3, bzip2, bsc and others.

I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED.

Every compression of a record implies an presumption that the compressed record tin beryllium decompressed to reproduce the original. Great efforts successful design, coding and testing person been made to guarantee that this programme useful correctly.

However, the complexity of the algorithms, and, successful particular, the beingness of various typical cases successful the codification which hap pinch very debased but non-zero probability make it intolerable to norm retired the anticipation of bugs remaining successful the program.

DO NOT COMPRESS ANY DATA WITH THIS PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.

That is not to opportunity this programme is inherently unreliable. Indeed, I very overmuch dream the other is true. Bzip3/libbz3 has been cautiously constructed and extensively tested.

Bzip3's capacity is heavily limited connected the compiler. x64 Linux clang13 builds usually tin spell arsenic precocious arsenic 17MiB/s compression and 23MiB/s decompression per thread. Windows and 32-bit builds mightiness beryllium considerably slower.

Bzip3 has been tested connected the pursuing architectures:

  • x86
  • x86_64
  • armv6
  • armv7
  • aarch64
  • ppc64le
  • mips
  • mips64
  • sparc
  • s390x

visualisation of the benchmarks

Check etc/BENCHMARKS.md for much results.

A breakdown of components and their licenses follows:

  • (runtime) The codebase arsenic a whole: Copyright 2022-2023, Kamila Szewczyk ([email protected]); LGPL (LICENSE)
  • (runtime) The Burrows-Wheeler toggle shape (libsais) and LZP code: 2021-2022, Ilya Grebnov ([email protected]); Apache 2.0 (3rdparty/libsais-LICENSE)
  • (compile-time) build-aux: Copyright 2011, Daniel Richard G ([email protected]), 2019, Marc Stevens ([email protected]), 2008, Steven G. Johnson ([email protected]); GPL-3+ pinch AutoConf exception
  • (compile-time) build-aux/ax_check_compile_flag.m4: Copyright 2008, Guido U. Draheim ([email protected]), 2011, Maarten Bosmans ([email protected]); FSFAP
  • (compile-time) build-aux/git-version-gen: Copyright 2007-2012,Software Foundation, Inc; GPLv3
  • (runtime) bz3grep: Copyright 2003, Thomas Klausner; BSD-2-clause

bzip3 arsenic a full is licensed nether LGPLv3 only. It is not dual-licensed nether LGPLv3 and Apache 2.0.

  • Ilya Grebnov for his libsais room utilized for BWT building successful BZip3 and the LZP encoder which I had utilized arsenic a reference implementation to amended myself.
  • Caleb Maclennan for configuring autotools arsenic a packaging-friendly build strategy for BZip3.
  • Ilya Muravyov for his nationalist domain BWT post-coder, a derivative of which is utilized successful this project.
More