GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Auto-port 5.0: Codec-compression: Add zlib decompressors by netty-project-bot · Pull Request #17167 · netty/netty

Conversation

@netty-project-bot

@netty-project-bot netty-project-bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Auto-port of #17155 to 5.0
Cherry-picked commit: 341a5f7


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:

  • 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 Fix GZIP FEXTRA extra-field handling in JdkZlibDecoder #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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yawkat @multicode-agent @netty-project-bot
Codec-compression: Add zlib decompressors (#17155)
be7a3a7
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:

* 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)
@netty-project-bot netty-project-bot mentioned this pull request Jul 28, 2026
Codec-compression: Add zlib decompressors #17155
Merged
@chrisvest chrisvest added this to the 5.0.0.Final milestone Jul 28, 2026
@chrisvest
chrisvest enabled auto-merge (squash) July 28, 2026 18:30
@chrisvest
chrisvest merged commit 5070b20 into 5.0 Jul 28, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest
chrisvest deleted the auto-port-pr-17155-to-5.0 branch July 28, 2026 19:32
@testlens-app

testlens-app Bot commented Jul 28, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: be7a3a7
▶️ Tests: 40201 executed
⚪️ Checks: 12/12 completed


Learn more about TestLens at testlens.app.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@netty-project-bot @chrisvest @yawkat
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.