ouch-org / ouch

Painless compression and decompression in the terminal
https://crates.io/crates/ouch
Other
2.27k stars 76 forks source link

Match Info-ZIP's default compression levels #111

Open marklit opened 3 years ago

marklit commented 3 years ago

I compressed a 3,853,508,608-byte SQLite3 file using ouch 0.2.0 and pkzip on macOS 11.6. The resulting zip ouch produced was 611,722,010 bytes which was 1,729,697 bytes smaller than Info-ZIP's version but it took 95.43 seconds while pkzip took 75.50 seconds.

Perhaps it's worth matching the default settings so the compression time is within range of Info-ZIP. Also, exposing compression options would be great as well.

marcospb19 commented 3 years ago

(About the compression level options, discussion is open at #52, ideas are welcome.)

marcospb19 commented 3 years ago

The documentation states that it uses this specification:

https://docs.rs/zip/0.5.13/zip/index.html

image

Does this explains it? Or it's just a compression level default configuration?

We use deflate, from what I have read online it seems like that is the same for infozip.

marcospb19 commented 3 years ago

It's currently not possible to change the deflate compression level:

https://github.com/zip-rs/zip/issues/212.

Will keep this open, we may try helping the contributors of that crate making it possible for ouch to configure it.

marcospb19 commented 2 years ago

This is now possible and no longer waiting on the ecosystem.