dyz1990 / sevenz-rust

A 7z decompressor/compressor lib written in pure rust
Apache License 2.0
146 stars 24 forks source link

compression performance issue compared to native 7z #19

Closed cboudereau closed 1 year ago

cboudereau commented 1 year ago

I ran a benchmark with the following config :

It takes 12x times. I noticed that the number of blocks was really different.

The example was json files

I used the info of 7z for windows to get this table.

Name Timing Size Packed Size Folders Files CRC Path Type Physical Size Headers Size Method Solid Blocks
7z manager windows (normal) 5s 275 460 238 4 041 321 548 28 062 5FA214C8 logs.7z 7z 4 690 530 649 209 LZMA2:24 + 1
7z manager windows (ultra) 21s 275 460 238 2 995 118 548 28 062 5FA214C8 by_files.7z 7z 3 644 327 649 209 LZMA2:26 + 1
examples\sevenz-rust-compression.rs 73s 275 460 238 13 107 812 0 28 062 5FA214C8 sample.7z 7z 16 818 429 3 710 617 LZMA2:23 - 28 062
dyz1990 commented 1 year ago

@cboudereau Thank's for your report. This library simply implements 7z compression. It performs poorly when compressing a large number of files. I know what the reason is, but I don't have much time to optimize at the moment. PR welcome.