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.

Reply via email to