Skip to content

Regression: Buffer ZIP Compressed Output #988

@belugabehr

Description

@belugabehr

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).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions