Skip to content

chore(deps): update dependency lz4 to v1.10.0#416

Open
deckhouse-BOaTswain wants to merge 2 commits into
ppfrom
renovate/lz4-1.x
Open

chore(deps): update dependency lz4 to v1.10.0#416
deckhouse-BOaTswain wants to merge 2 commits into
ppfrom
renovate/lz4-1.x

Conversation

@deckhouse-BOaTswain

@deckhouse-BOaTswain deckhouse-BOaTswain commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
lz4 http_archive minor v1.9.2 -> v1.10.0

Release Notes

lz4/lz4 (lz4)

v1.10.0: LZ4 v1.10.0 - Multicores edition

Compare Source

LZ4 v1.10.0 introduces major updates, integrating 600+ commits that significantly enhance its capabilities. This version brings multithreading support to the forefront, harnessing modern multi-core processors to accelerate both compression and decompression processing. It's a good upgrade for users looking to optimize performance in high-throughput environments.

Multithreading support

The most visible upgrade of this version is likely Multithreading support. While LZ4 has historically been recognized for its high-speed compression, the demand for even faster throughput has grown, particularly with the advent of nvme storage technologies that allow for multi-GB/s throughput.
Multithreading is particularly beneficial for High Compression modes, which now perform dramatically faster. The following benchmark table showcases the performance improvements:

source cpu os level v1.9.4 v1.10.0 Improvement
silesia.tar 7840HS Win11 12 13.4 sec 1.8 sec x7.4
silesia.tar M1 Pro macos 12 16.6 sec 2.55 sec x6.5
silesia.tar i7-9700k linux 12 16.2 sec 3.05 sec x5.4
enwik9 7840HS Win11 9 20.8 sec 2.6 sec x8.0
enwik9 M1 Pro macos 9 22.1 sec 2.95 sec x7.4
enwik9 i7-9700k linux 9 22.9 sec 4.05 sec x5.7

Multithreading is less critical for decompression, as modern nvme drives can still be saturated with a single decompression thread. Nonetheless, the new version enhances performance by overlapping I/O operations with decompression processes.
Tested on a x64 linux platform, decompressing a 5 GB text file locally takes 5 seconds with v1.9.4;
this is reduced to 3 seconds in v1.10.0, corresponding to > +60% performance improvement.

Official support for dictionary compression (and decompression)

Starting from v1.10.0, dictionary compression, previously tagged as "experimental", now receives full support. This upgrade assures stability and ongoing support for the feature, enabling developers to reliably use this functionality in their applications.
The new symbols supported by liblz4 are :

  • LZ4_loadDictSlow(): minor variant of LZ4_loadDict(), which consumes more initialization time to better reference the dictionary, resulting in slightly improved compression ratios.
  • LZ4_attach_dictionary(): use in-place a LZ4 state initialized with a dictionary, to perform dictionary compression (LZ4 Block format) without the initialization costs. Very useful for small data, where dictionary initialization can become a bottleneck. The dictionary state can be used by multiple threads concurrently.
  • LZ4_attach_HC_dictionary(): same as LZ4_attach_dictionary(), but for LZ4HC dictionary compression.
  • LZ4F_compressBegin_usingDict(): initiate streaming compression to the LZ4Frame format, using a Dictionary.
  • LZ4F_decompress_usingDict(): decompress a LZ4Frame requiring a Dictionary
  • LZ4F_createCDict() : create a materialized dictionary, ready to start compression without initialization cost. Can be shared across multiple threads.
  • LZ4F_compressFrame_usingCDict(): one-shot compression to the LZ4Frame format, using materialized CDict
  • LZ4F_compressBegin_usingCDict(): initiate streaming compression to the LZ4Frame format, using materialized CDict
New compression level 2

The new "Level 2" compression effectively fills the substantial gap between the standard "Fast Level 1" and the more intensive "High Compression Level 3." It provides a balanced option, optimizing performance and compression as evidenced in the benchmark results below (i7-9700k, linux):

file level 1 level 2 level 3
silesia.tar (speed) 685 MB/s 315 MB/s 110 MB/s
silesia.tar (ratio) x2.101 x2.378 x2.606

Level 2 is ideal for applications requiring better compression than lz4 level 1, without the speed trade-offs associated with HC level 3.

Miscellaneous
  • The CLI now supports the environment variables LZ4_CLEVEL and LZ4_NBWORKERS, offering flexible control over its behavior in scenarios where direct commands are impractical, or when customized local defaults are necessary.
  • The licensing for the CLI and test programs has been clarified to GPL-2.0-or-later to distinguish it from GPL-2.0-only, enhancing transparency. The liblz4 library maintains its BSD-2 clause license.
  • Various less common platforms have been validated (loongArch, risc-v, m68k, mips and sparc), and are now continuously tested in CI, to ensure portability.
  • Visual Studio solutions are now generated from cmake recipe, in an effort to reduce manual maintenance of multiple Solutions.
One-liner updates
  • cli : multithreading compression support: improves speed by X times threads allocated
  • cli : overlap decompression with i/o, improving speed by >+60%
  • cli : support environment variables LZ4_CLEVEL and LZ4_NBWORKERS
  • cli : license of CLI more clearly labelled GPL-2.0-or-later
  • cli : fix: refuse to compress directories
  • cli : fix dictionary compression benchmark on multiple files
  • cli : change: no more implicit stdout (except when input is stdin)
  • lib : new level 2, offering mid-way performance (speed and compression)
  • lib : Improved lz4frame compression speed for small data (up to +160% at 1KB)
  • lib : Slightly faster (+5%) HC compression speed (levels 3-9), by @​JunHe77
  • lib : dictionary compression support now in stable status
  • lib : lz4frame states can be safely reset and reused after a processing error (described by @​QrczakMK)
  • lib : lz4file API improvements, by @​vsolontsov-volant and @​t-mat
  • lib : new experimental symbol LZ4_compress_destSize_extState()
  • build: cmake minimum version raised to 3.5
  • build: cmake improvements, by @​foxeng, @​Ohjurot, @​LocalSpook, @​teo-tsirpanis, @​ur4t and @​t-mat
  • build: meson scripts are now hosted into build/ directory, by @​eli-schwartz
  • build: meson improvements, by @​tristan957
  • build: Visual Studio solutions generated by cmake via scripts
  • port : support for loongArch, risc-v, m68k, mips and sparc architectures
  • port : improved Visual Studio compatibility, by @​t-mat
  • port : freestanding support improvements, by @​t-mat
Automated change log

New Contributors

Full Changelog: lz4/lz4@v1.9.4...v1.10.0

edit: the lz4-1.10.0.tar.gz artifact has been updated because the initial version was embedding some macos specific stuff.

edit 2: the windows binary packages have been updated to fix a bug affecting time measurement when compressing extremely large files.

v1.9.4: LZ4 v1.9.4

Compare Source

LZ4 v1.9.4 is a maintenance release, featuring a substantial amount (~350 commits) of minor fixes and improvements, making it a recommended upgrade. The stable portion of liblz4 API is unmodified, making this release a drop-in replacement for existing features.

Improved decompression speed

Performance wasn't a major focus of this release, but there are nonetheless a few improvements worth mentioning :

  • Decompression speed on high-end ARM64 platform is improved, by ~+20%. This is notably the case for recent M1 chips, featured in macbook laptops and nucs. Some server-class ARM64 cpus are also impacted, most notably when employing gcc as a compiler. Due to the diversity of aarch64 chips in service, it's still difficult to have a one-size-fits-all policy for this platform.
  • For the specific scenario of data compressed with -BD4 setting (small blocks, <= 64 KB, linked) decompressed block-by-block into a flush buffer, decompression speed is improved ~+70%. This is most visible in the lz4 CLI, which triggers this exact scenario, but since the improvement is achieved at library level, it may also apply to other scenarios.
  • Additionally, for compressed data employing the lz4frame format (native format of lz4 CLI), it's possible to ignore checksum validation during decompression, resulting in speed improvements of ~+40% . This capability is exposed at both CLI (see --no-crc) and library levels.
New experimental library capabilities

New liblz4 capabilities are provided in this version. They are considered experimental at this stage, and the most useful ones will be upgraded as candidate "stable" status in an upcoming release :

  • Ability to require lz4frame API to employ custom allocators for dynamic allocation.
  • Partial decompression of LZ4 blocks compressed with a dictionary, using LZ4_decompress_safe_partial_usingDict() by @​yawqi
  • Create lz4frame blocks which are intentionally uncompressed, using LZ4F_uncompressedUpdate(), by @​alexmohr
  • New API unit lz4file, abstracting File I/O operations for higher-level programs and libraries, by @​anjiahao1
  • liblz4 can be built for freestanding environments, using the new build macro LZ4_FREESTANDING, by @​t-mat. In which case, it will not link to any standard library, disable all dynamic allocations, and rely on user-provided memcpy() and memset() operations.
Miscellaneous
  • Fixed an annoying Makefile bug introduced in v1.9.3, in which CFLAGS was no longer respected when provided from environment variable. The root cause was an obscure bug in make, which has been fixed upstream following this bug report. There is no need to update make to build liblz4 though, the Makefile has been modified to circumvent the issue and remains compatible with older versions of make.
  • Makefile is compatible with -j parallel run, including to run parallel tests (make -j test).
  • Documentation of LZ4 Block format has been updated, featuring notably a paragraph "Implementation notes", underlining common pitfalls for new implementers of the format
Changes list

Here is a more detailed list of updates introduced in v1.9.4 :

  • perf : faster decoding speed (~+20%) on Apple Silicon platforms, by @​zeux
  • perf : faster decoding speed (~+70%) for -BD4 setting in CLI
  • api : new function LZ4_decompress_safe_partial_usingDict() by @​yawqi
  • api : lz4frame: ability to provide custom allocators at state creation
  • api : can skip checksum validation for improved decoding speed
  • api : new experimental unit lz4file for file i/o API, by @​anjiahao1
  • api : new experimental function LZ4F_uncompressedUpdate(), by @​alexmohr
  • cli : --list works on stdin input, by @​Low-power
  • cli : --no-crc does not produce (compression) nor check (decompression) checksums
  • cli : fix: --test and --list produce an error code when parsing invalid input
  • cli : fix: --test -m does no longer create decompressed file artifacts
  • cli : fix: support skippable frames when passed via stdin, reported by @​davidmankin
  • build: fix: Makefile respects CFLAGS directives passed via environment variable
  • build: LZ4_FREESTANDING, new build macro for freestanding environments, by @​t-mat
  • build: make and make test are compatible with -j parallel run
  • build: AS/400 compatibility, by @​jonrumsey
  • build: Solaris 10 compatibility, by @​pekdon
  • build: MSVC 2022 support, by @​t-mat
  • build: improved meson script, by @​eli-schwartz
  • doc : Updated LZ4 block format, provide an "implementation notes" section

New Contributors

v1.9.3: LZ4 v1.9.3

Compare Source

LZ4 v1.9.3 is a maintenance release, offering more than 200+ commits to fix multiple corner cases and build scenarios. Update is recommended. Existing liblz4 API is not modified, so it should be a drop-in replacement.

Faster Windows binaries

On the build side, multiple rounds of improvements, thanks to contributors such as @​wolfpld and @​remittor, make this version generate faster binaries for Visual Studio. It is also expected to better support a broader range of VS variants.
Speed benefits can be substantial. For example, on my laptop, compared with v1.9.2, this version built with VS2019 compresses at 640 MB/s (from 420 MB/s), and decompression reaches 3.75 GB/s (from 3.3 GB/s). So this is definitely perceptible.

Other notable updates

Among the visible fixes, this version improves the _destSize() variant, an advanced API which reverses the logic by targeting an a-priori compressed size and trying to shove as much data as possible into the target budget. The high compression variant LZ4_compress_HC_destSize() would miss some important opportunities in highly compressible data, resulting in less than optimal compression (detected by @​hsiangkao). This is fixed in this version. Even the "fast" variant receives some gains (albeit very small).
Also, the corresponding decompression function, LZ4_decompress_safe_partial(), officially supports a scenario where the input (compressed) size is unknown (but bounded), as long as the requested amount of data to regenerate is smaller or equal to the block's content. This function used to require the exact compressed size, and would sometimes support above scenario "by accident", but then could also break it by accident. This is now firmly controlled, documented and tested.

Finally, replacing memory functions (malloc(), calloc(), free()), typically for freestanding environments, is now a bit easier. It used to require a small direct modification of lz4.c source code, but can now be achieved by using the build macro LZ4_USER_MEMORY_FUNCTIONS at compilation time. In which case, liblz4 no longer includes <stdlib.h>, and requires instead that functions LZ4_malloc(), LZ4_calloc() and LZ4_free() are implemented somewhere in the project, and then available at link time.

Changes list

Here is a more detailed list of updates introduced in v1.9.3 :

  • perf: highly improved speed in kernel space, by @​terrelln
  • perf: faster speed with Visual Studio, thanks to @​wolfpld and @​remittor
  • perf: improved dictionary compression speed, by @​felixhandte
  • perf: fixed LZ4_compress_HC_destSize() ratio, detected by @​hsiangkao
  • perf: reduced stack usage in high compression mode, by @​Yanpas
  • api : LZ4_decompress_safe_partial() supports unknown compressed size, requested by @​jfkthame
  • api : improved LZ4F_compressBound() with automatic flushing, by Christopher Harvie
  • api : can (de)compress to/from NULL without UBs
  • api : fix alignment test on 32-bit systems (state initialization)
  • api : fix LZ4_saveDictHC() in corner case scenario, detected by @​IgorKorkin
  • cli : compress multiple files using the legacy format, by Filipe Calasans
  • cli : benchmark mode supports dictionary, by @​rkoradi
  • cli : fix --fast with large argument, detected by @​picoHz
  • build: link to user-defined memory functions with LZ4_USER_MEMORY_FUNCTIONS
  • build: contrib/cmake_unofficial/ moved to build/cmake/
  • build: visual/* moved to build/
  • build: updated meson script, by @​neheb
  • build: tinycc support, by Anton Kochkov
  • install: Haiku support, by Jerome Duval
  • doc : updated LZ4 frame format, clarify EndMark

Known issues :

  • Some people have reported a broken liblz4_static.lib file in the package lz4_win64_v1_9_3.zip. This is probably a mingw / msvc compatibility issue. If you have issues employing this file, the solution is to rebuild it locally from sources with your target compiler.
  • The standard Makefile in v1.9.3 doesn't honor CFLAGS when passed through environment variable. This is fixed in more recent version on dev branch. See #​958 for details.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@vporoshok vporoshok added this to the v0.9.0 milestone Jul 22, 2026
@vporoshok vporoshok self-assigned this Jul 22, 2026
@vporoshok vporoshok added the wip label Jul 22, 2026
The lz4 1.9.2 -> 1.10.0 bump left the local patches unaligned with the
new upstream sources, so patches 0001-0003 no longer applied. Rebase
them against the 1.10.0 layout:

- 0001: visibility is now controlled via the LZ4FLIB_VISIBILITY macro
- 0002: relocate the LZ4F_allocated_memory hunks to the new context
- 0003: offsetof rewrite adapts to the LZ4_ALIGN_TEST-guarded typedef

Verified all four patches apply with `patch -p0` on a fresh v1.10.0
tree and that the patched sources compile warning-clean.

Co-authored-by: Cursor <cursoragent@cursor.com>
@deckhouse-BOaTswain

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants