[systemd-devel] [PATCH] Improve xz compression performance.
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Tue Jul 8 20:20:45 PDT 2014
On Tue, Jul 08, 2014 at 06:29:46PM +0200, Jon Severinsson wrote:
> The new lzma2 compression options at the top of compress_blob_xz are
> equivalent to using preset "0", exept for using a 1 MiB dictionary
> (the same as preset "1"). This makes the memory usage at most 7.5 MiB
> in the compressor, and 1 MiB in the decompressor, instead of the
> previous 92 MiB in the compressor and 8 MiB in the decompressor.
>
> According to test-compress-benchmark this commit makes XZ compression
> 20 times faster, with no increase in compressed data size.
> Using more realistic test data (an ELF binary rather than repeating
> ASCII letters 'a' through 'z' in order) it only provides a factor 10
> speedup, and at a cost if a 10% increase in compressed data size.
> But that is still a worthwhile trade-off.
>
> According to test-compress-benchmark XZ compression is still 25 times
> slower than LZ4, but the compressed data is one eighth the size.
> Using more realistic test data XZ compression is only 18 times slower
> than LZ4, and the compressed data is only one quarter the size.
Nice improvement.
I made some whitespace modifications and added static to the options
and pushed it.
If you modified test-compress-benchmark to use more realistic data,
please send a patch.
Zbyszek
More information about the systemd-devel
mailing list