JDK-6975829 : Perf. of gzip in existing JDKs is too slower than in 1.3.1
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 6u21
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2010-08-10
  • Updated: 2013-11-01
  • Resolved: 2011-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6-poolResolved 7 b116Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
A CU tries to migrate from 1.3.1_10 to jdk5ux.
They found the perf. of gzip becomes too slower in jdk5ux than 1.3.1_XX.

REPRODUCE :
1. Compile the attached DISTest.java
2. Invoke "java DISTest"

CONFIGURATION:
JDK: 1.4.2_22/5u22/6u21/7b99
OS: WindowsXP/WindowsVista(32bits on x64, Japanese)

RESULT:
CU reports that the perf. of gzip in the existing JDKs is 4 - 100 times worse than
in 1.3.1.
The following is the result of reproduction at Oracle side.
Averagely, perf. seems 2 times worse than in 1.3.1.

-----
C:\Users\licensees\slow-gzip>java -version
java version "1.3.1_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_19-b03)
Java HotSpot(TM) Client VM (build 1.3.1_19-b03, mixed mode)

C:\Users\licensees\slow-gzip>java DISTest
finished.
time: 489msecs.

---------
C:\Users\licensees\slow-gzip>java -version
java version "1.4.2_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_22-b02)
Java HotSpot(TM) Client VM (build 1.4.2_22-b02, mixed mode)

C:\Users\licensees\slow-gzip>java DISTest
finished.
time: 1152msecs.

---------
C:\Users\licensees\slow-gzip>java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode)

C:\Users\licensees\slow-gzip>java DISTest
finished.
time: 1142msecs.

----------
C:\Users\licensees\slow-gzip>java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode)

C:\Users\licensees\slow-gzip>java DISTest
finished.
time: 974msecs.

----------
C:\Users\licensees\slow-gzip>java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b99)
Java HotSpot(TM) Client VM (build 19.0-b03, mixed mode)

C:\Users\licensees\slow-gzip>java DISTest
finished.
time: 946msecs.


NOTE:
In quick check with hprof, load percentage of java.util.zip.Inflater.inflateBytes
in the existing JDKs becomes high.

Comments
EVALUATION It appears the buffer/memory usage in Inflater.c can be improved to achieve much better performance for GZIPInputStream/InflaterInputStream. Also, the test can run "much" faster by adding a BufferedInputStream between DataInputStream and GZIPInputStream.
30-09-2010

EVALUATION The issue of zip performance has a long history (see 6206933 and related bugs). The topic has also been discussed on the core-libs-dev mailing list. Here is one thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2007-December/000135.html
14-08-2010