GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — Auto-port 5.0: Codec-compression: Add zlib decompressors by netty-project-bot · Pull Request #17167 · netty/netty Conversation
Contributor
Auto-port of #17155 to 5.0 Motivation: The new decompressor API work in #15667 is being split into smaller, independently reviewable changes as tracked by #16743. The core decompressor API has already landed in #16745; this PR extracts the JDK zlib-specific portion. Modification:
The new pull API intentionally uses only the JDK implementation. The existing Result: ZLIB, GZIP, and raw-deflate streams can be decompressed through the new pull-based Performance: A temporary JMH comparison of one-shot construction and ZLIB decompression on OpenJDK 21.0.11 found the JDK implementation faster for the tested payloads:
The benchmark used one thread, two forks, 3 x 500 ms warmups, and 5 x 500 ms measurements per fork. The 150 KiB cases covered heap/direct input and 8 KiB/1 MiB maximum allocations. These results are directional rather than a universal performance claim, but showed no performance reason to retain the JZlib variant. Verification:
Part of #16743.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation: The new decompressor API work in #15667 is being split into smaller, independently reviewable changes as tracked by #16743. The core decompressor API has already landed in #16745; this PR extracts the JDK zlib-specific portion. Modification: * Add a JDK-backed zlib decompressor exposed through `JdkZlibDecompressor.builder()`. * Support ZLIB, GZIP, raw-deflate, and ZLIB-or-raw auto-detection, preset dictionaries, bounded output allocation, and concatenated GZIP members. * Add focused decompressor contract and regression tests. * Port #16951's GZIP FEXTRA handling and concatenated-member regression coverage. * Harden EOF/truncation handling, output-buffer ownership, inflater cleanup, allocation validation, and GZIP header validation. * Cover direct-buffer input across partial output consumption. The new pull API intentionally uses only the JDK implementation. The existing `JZlibDecoder` selection behavior in the established `ZlibCodecFactory.newZlibDecoder(...)` APIs remains unchanged. Result: ZLIB, GZIP, and raw-deflate streams can be decompressed through the new pull-based `Decompressor` API. The implementation also supports wrapper auto-detection and concatenated GZIP streams without adding a second JZlib-backed pull implementation or changing `ZlibCodecFactory`. Performance: A temporary JMH comparison of one-shot construction and ZLIB decompression on OpenJDK 21.0.11 found the JDK implementation faster for the tested payloads: | Uncompressed size | JDK | JZlib | JDK advantage | |---:|---:|---:|---:| | 1 KiB | 187,927 ops/s | 76,748 ops/s | 2.45x | | 150 KiB | ~5,291-5,353 ops/s | ~1,686-1,711 ops/s | ~3.1x | | 1 MiB | 916.7 ops/s | 536.2 ops/s | 1.71x | The benchmark used one thread, two forks, 3 x 500 ms warmups, and 5 x 500 ms measurements per fork. The 150 KiB cases covered heap/direct input and 8 KiB/1 MiB maximum allocations. These results are directional rather than a universal performance claim, but showed no performance reason to retain the JZlib variant. Verification: * `./mvnw -pl codec-compression test`: 411 tests passed with no failures or errors. * `JdkZlibDecompressorTest`: 33 focused cases passed. * Checkstyle, Java compilation, module generation, and packaging completed successfully. Part of #16743. --------- Co-authored-by: multicode <[email protected]> (cherry picked from commit 341a5f7)
chrisvest
enabled auto-merge (squash)
Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |