[jdk25u-dev] RFR: 8374644: Regression in GZIPInputStream performance after JDK-7036144

Roland Mesde duke at openjdk.org
Fri Jan 9 17:56:31 UTC 2026


Backporting JDK-8374644: Regression in GZIPInputStream performance after JDK-7036144

This PR fixes a performance regression in GZIPInputStream introduced in JDK 23 by JDK-7036144. The original change replaced InputStream.available() with explicit InputStream.read() calls to detect concatenated GZIP streams, but this caused EOFException construction in the common case of single GZIP streams.

Since Throwable construction involves expensive stacktrace filling, this created a performance regression for the most common use case. The fix introduces an alternate code path in readHeader() that avoids EOFException generation when the stream has reached EOF, restoring performance to JDK 22 levels while maintaining the functional improvements from JDK-7036144.

This backport has internal demand.

Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:

make test TEST=test/jdk/java/util/zip/GZIP

-------------

Commit messages:
 - Backport a4fb07ee3e26c2f0ed3111c39c3a22167d292d04

Changes: https://git.openjdk.org/jdk25u-dev/pull/139/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk25u-dev&pr=139&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374644
  Stats: 49 lines in 1 file changed: 41 ins; 1 del; 7 mod
  Patch: https://git.openjdk.org/jdk25u-dev/pull/139.diff
  Fetch: git fetch https://git.openjdk.org/jdk25u-dev.git pull/139/head:pull/139

PR: https://git.openjdk.org/jdk25u-dev/pull/139


More information about the jdk-updates-dev mailing list