Repository navigation
Statically link zlib-ng in Linux wheels for 2.5x faster PNG write - #10495
Merged
Merged
Conversation
radarhere
approved these changes
Nov 12, 2026
radarhere
left a comment
Member
There was a problem hiding this comment.
Interestingly, test_wheel_zlib_ng_linked_statically() only fails on PyPy on manylinux. It passes on CPython or on musllinux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10469.
This means the Linux wheels will use zlib-ng from the wheel, not whatever happens to be on the machine, whether that's zlib or zlib-ng. Or nothing at all, as happened in #10469.
Here's benchmarks using the same script from #8500.
Compared
pillow-13.0.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whlfrom PyPI, andpillow-13.1.0.dev0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whlfrom this fork.Script
Output
Time has same shape as #8500:
Interestingly, the zlib-ng times at level 9 are 2.79s (#8500, Windows x86_64) versus 2.80s (here, aarch64 in a Docker VM), almost identical on different machines!
File sizes are identical to #8500.