Code Review Request for # 6975829 : Perf. of gzip in existing JDKs is too slower than in 1.3.1

Alan Bateman Alan.Bateman at oracle.com
Fri Oct 1 11:03:29 UTC 2010


Xueming Shen wrote:
> :
>
> It still appears the memory/buffer handling code in Inflater.c can be 
> changed to improve
> the performance in use cases similar to above mentioned scenario. The 
> proposed change
> is to copy no more than the size of the "user's buffer". It's an 
> de-compression, so you can't
> consume more bytes than you can write out in most cases. The attached 
> test case shows
> the performance of gzip-ing the un-compressed rt.jar by using 
> different buffer size.
Good find!

It might be a bit clearer in the Z_OK/Z_NEED_DICT cases if you added a 
"consumed" variable, eg:

case Z_OK:
    jint consumed = in_len - strm->avail_in;
    :

That would make the update of the input off/len a bit clearer.

Otherwise looks good to me.

-Alan.



More information about the core-libs-dev mailing list