commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject [COMPRESS] performance improvement in Ant's ZipOutputStream
Date Wed, 16 Jul 2008 13:20:10 GMT
Hi all,

I couldn't find a JIRA for compress so I'm posting it here.

We had a bug report against Ant's ZipOutputStream that showed that the
class had a way worse performance compared to's cousin
when it was used to compress big files.  See

Attached to this report is a small test class that could easily be
adapted to the compress library.

It turns out that java.util.Deflater doesn't like to see big arrays
passed into its setInput method and the original reporter says
OpenJDK's code would split the input into 512 byte chunks.  While I
didn't verify the OpenJDK code I went looking into zlib and InfoZIP
and at least InfoZIP's zipup.c uses smaller chunks (between 2kB and
16kB) as well when compressing files.

The change I've committed
sped up the test by a factor of 40 on my machine.

It won't have any effect on Ant since <zip> has always split up the
file's content before writing it to the archive, but it would affect
other direct users of our API - and would probably benefit the
compress component for just that reason as well.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message