There was a recent change to remove BufferedOutputStream for the ZIP Compression Strategy:
a8e6fa4. This is potentially a serious performance regression.
|
try (FileInputStream fis = new FileInputStream(originalFileName); |
|
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(compressedFileName))) { |
Please revert this and instead use a BufferedOutputStream initialized with BUFFER_SIZE.
Some of the other compression algos, namely GZIP, have an internal buffer that can be tuned, ZIP does not.
So, what you'll likely see is that, a 8KB block of read data, may be compressed into many small token, each one of them will be written to disk with their own IO request + seek (depending on internal disk buffering, but not good to rely on that).
There was a recent change to remove
BufferedOutputStreamfor the ZIP Compression Strategy:a8e6fa4. This is potentially a serious performance regression.
logback/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/ZipCompressionStrategy.java
Lines 66 to 67 in 681b2be
Please revert this and instead use a
BufferedOutputStreaminitialized withBUFFER_SIZE.Some of the other compression algos, namely GZIP, have an internal buffer that can be tuned, ZIP does not.
So, what you'll likely see is that, a 8KB block of read data, may be compressed into many small token, each one of them will be written to disk with their own IO request + seek (depending on internal disk buffering, but not good to rely on that).