Zstandard v1.5.6 - Chrome Edition2024-03-31
This release highlights the deployment of Google Chrome 123, introducing zstd-encoding for Web traffic, offered as a preferable option for compression of dynamic contents. With limited web server support for zstd-encoding due to its novelty, we are launching an updated Zstandard version to facilitate broader adoption.
Improved latency (time to first delivered byte) for web pages
Using zstd compression for large documents over the Internet, data is segmented into smaller blocks. This is crucial for applications like Chrome that process parts of documents as they arrive. However, blocks can have a size of up to 128 KB by default, which can be large for congested networks.
To mitigate such scenarios and improve "time to first delivered byte", libzstd introduces the new parameter ZSTDctargetCBlockSize, enabling the division of blocks into even smaller segments, resulting in desirable latency reduction, notably beneficial in areas with more congested network infrastructure.
This parameter must be set explicitly, because it is not free: it incurs a small cpu cost (equivalent to -2% speed at level 8) and a small compression efficiency decrease (<0.1%), both of which look reasonable but nonetheless non-zero.
Improved compression ratio at high levels
Highest compression levels (typically 18+) receive some compression ratio improvement. The improvement is really noticeable for 32-bit structures, like arrays of int for example. A real-world example would the .debugstroffsets section of DWARF debug info within ELF executables, mentioned in #2832, for which the compression effectiveness increases by +35%. It's not rare for many files or objects to contain sections of 32-bit structures, resulting in corresponding compression ratio improvements.
Granular binary size selection
libzstd provides build customization, including options to compile only the compression or decompression modules, minimizing binary size. Enhanced in v1.5.6 (source), it now allows for even finer control by enabling selective inclusion or exclusion of specific components within these modules. This advancement aids applications needing precise binary size management.
Miscellaneous Enhancements
This release includes various minor enhancements and bug fixes to enhance user experience. Key updates include an expanded list of recognized compressed file suffixes for the --exclude-compressed flag, improving efficiency by skipping presumed incompressible content. Furthermore, compatibility has been broadened to include additional chipsets (sparc64, ARM64EC, risc-v) and operating systems (QNX, AIX, Solaris, HP-UX).
Change Log
api: Promote ZSTDctargetCBlockSize to Stable API by @felixhandte
api: new experimental ZSTDdmaxBlockSize parameter, to reduce streaming decompression memory, by @terrelln
perf: improve performance of param ZSTDctargetCBlockSize, by @Cyan4973
perf: improved compression of arrays of integers at high compression, by @Cyan4973
lib: reduce binary size with selective built-time exclusion, by @felixhandte
lib: improved huffman speed on small data and linux kernel, by @terrelln
lib: accept dictionaries with partial literal tables, by @terrelln
lib: fix CCtx size estimation with external sequence producer, by @embg
lib: fix corner case decoder behaviors, by @Cyan4973 and @aimuz
lib: fix zdict prototype mismatch in static_only mode, by @ldv-alt
lib: fix several bugs in magicless-format decoding, by @embg
cli: add common compressed file types to --exclude-compressed by @daniellerozenblit (requested by @dcog989)
cli: fix mixing -c and -o commands with --rm, by @Cyan4973
cli: fix erroneous exclusion of hidden files with --output-dir-mirror by @felixhandte
cli: improved time accuracy on BSD, by @felixhandte
cli: better errors on argument parsing, by @KapJI
tests: better compatibility with older versions of grep, by @Cyan4973
tests: lorem ipsum generator as default content generator, by @Cyan4973
build: cmake improvements by @terrelln, @sighingnow, @gjasny, @JohanMabille, @Saverio976, @gruenich, @teo-tsirpanis
build: bazel support, by @jondo2010
build: fix cross-compiling for AArch64 with lld by @jcelerier
build: fix Apple platform compatibility, by @nidhijaju
build: fix Visual 2012 and lower compatibility, by @Cyan4973
build: improve win32 support, by @DimitriPapadopoulos
build: better C90 compliance for zlibWrapper, by @emaste
port: make: fat binaries on macos, by @mredig
port: ARM64EC compatibility for Windows, by @dunhor
port: QNX support by @klausholstjacobsen
port: MSYS2 and Cygwin makefile installation and test support, by @QBos07
port: risc-v support validation in CI, by @Cyan4973
port: sparc64 support validation in CI, by @Cyan4973
port: AIX compatibility, by @likema
port: HP-UX compatibility, by @likema
doc: Improved specification accuracy, by @elasota
bug: Fix and deprecate ZSTD_generateSequences (#3981), by @terrelln
Full change list (auto-generated)
* Add win32 to windows-artifacts.yml by @Kim-SSi in https://github.com/facebook/zstd/pull/3600
* Fix mmap-dict help output by @daniellerozenblit in https://github.com/facebook/zstd/pull/3601
[oss-fuzz] Fix simpleround_trip fuzzer with overlapping decompression by @terrelln in https://github.com/facebook/zstd/pull/3612
* Reduce streaming decompression memory by (128KB - blockSizeMax) by @terrelln in https://github.com/facebook/zstd/pull/3616
* removed travis & appveyor scripts by @Cyan4973 in https://github.com/facebook/zstd/pull/3621
Add ZSTDd_maxBlockSize parameter by @terrelln in https://github.com/facebook/zstd/pull/3617
* [doc] add decoder errata paragraph by @Cyan4973 in https://github.com/facebook/zstd/pull/3620
* add makefile entry to build fat binary on macos by @mredig in https://github.com/facebook/zstd/pull/3614
* Disable unused variable warning in msan configurations by @danlark1 in https://github.com/facebook/zstd/pull/3624
https://github.com/facebook/zstd/pull/3634
* Allow Build-Time Exclusion of Individual Compression Strategies by @felixhandte in https://github.com/facebook/zstd/pull/3623
* Get zstd working with ARM64EC on Windows by @dunhor in https://github.com/facebook/zstd/pull/3636
minor : update streamingcompression example by @Cyan4973 in https://github.com/facebook/zstd/pull/3631
* Fix UBSAN issue (zero addition to NULL) by @terrelln in https://github.com/facebook/zstd/pull/3658
* Add options in Makefile to cmake by @sighingnow in https://github.com/facebook/zstd/pull/3657
fix a minor inefficiency in compresssuperblock by @Cyan4973 in https://github.com/facebook/zstd/pull/3668
* Fixed a bug in the educational decoder by @Cyan4973 in https://github.com/facebook/zstd/pull/3659
* changed LLU suffix into ULL for Visual 2012 and lower by @Cyan4973 in https://github.com/facebook/zstd/pull/3664
* fixed decoder behavior when nbSeqs==0 is encoded using 2 bytes by @Cyan4973 in https://github.com/facebook/zstd/pull/3669
* detect extraneous bytes in the Sequences section by @Cyan4973 in https://github.com/facebook/zstd/pull/3674
* Bitstream produces only zeroes after an overflow event by @Cyan4973 in https://github.com/facebook/zstd/pull/3676
* Update FreeBSD CI images to latest supported releases by @emaste in https://github.com/facebook/zstd/pull/3684
* Clean up a false error message in the LDM debug log by @embg in https://github.com/facebook/zstd/pull/3686
* Hide ASM symbols on Apple platforms by @nidhijaju in https://github.com/facebook/zstd/pull/3688
* Changed the decoding loop to detect more invalid cases of corruption sooner by @Cyan4973 in https://github.com/facebook/zstd/pull/3677
* Fix Intel Xcode builds wi