Performance regression in java.util.zip.Deflater

Clemens Eisserer linuxhippy at gmail.com
Thu Dec 20 21:36:39 UTC 2007


Hi again,

> Sun engineers have tried to get reasonable performance
> without using JNI_Get*Critical, since that introduces other
> serious performance problems.  It was my belief that any
> pathological n^2 performance problems had been truly fixed.
At least the code in JDK7u23 looks like (n^2)/2 or something like
that, it copies every time the whole bytes which are left, including
malloc/free.

> Sun engineers have tried to get reasonable performance
> without using JNI_Get*Critical, since that introduces other
> serious performance problems.
Could please tell me when and why. As far as I understood the problem
with the *Critical*-Functions is that they hinder the JVM in doing
some operations (GC, ...) which limits scalability.

If this is the only reson, using them may not be that bad if the
Get*ArrayRegion also has some GC-atomic behaviour. Copying 50mb data
atomically also blocks the GC, doesn't it?

I am working on a fix which processes the data in "strides", therefor
the lock is only held a short time. Is this really a bad idea, except
for the additional JNI overhead?

Thanks, lg Clemens



More information about the core-libs-dev mailing list