[systemd-devel] [PATCH 1/2] journal: add LZ4 as optional compressor

Jon Severinsson jon at severinsson.net
Tue Jul 8 03:22:54 PDT 2014


Am 06.07.2014 21:47, schrieb Lennart Poettering:
> BTW, have you checked whether reuseing the XZ context might make the XZ
> more competitive?

On Sun Jul 6 15:01:11 PDT 2014 Reindl Harald wrote:
> please try a simple test compress 50 MB with XZ and GZ, LZO, LZ4
> or BZIP2 - XZ is *magnitudes* slower in any case

Actually it is not, or rather, it is only that if you want it to be that.
I did a quick comparison using the systemd 214 tar (30 MiB):
xz -0 was 28% slower than lz4c -hc, but the result was 19% smaller. 
xz -0 was even 44% faster than gzip -9, and the result was still 5% smaller.

> XZ is the wrong compression for anything where user feedback in time matters

No, xz -6 is the wrong compression *setting* for that use-case, but at a lower 
setting xz is quite suitable even for that.

> even with no care about memory usage which also is part of the game finally

xz -0 needs about 3 MiB for compression, hardly a prohibitive requirement.

---
jon at ilyena /tmp $ time lz4c -hc systemd-214.tar
Compressed filename will be : systemd-214.tar.lz4 
Compressed 31436800 bytes into 5120576 bytes ==> 16.29%                        
real    0m2.751s
user    0m2.696s
sys     0m0.052s
jon at ilyena /tmp $ time gzip -9 -k systemd-214.tar
real    0m6.247s
user    0m6.164s
sys     0m0.032s
jon at ilyena /tmp $ time xz -0 -k systemd-214.tar
real    0m3.715s
user    0m3.464s
sys     0m0.032s
jon at ilyena /tmp $ ls -s systemd-214.tar*
30700 systemd-214.tar
 5004 systemd-214.tar.lz4
 4288 systemd-214.tar.gz
 4072 systemd-214.tar.xz


More information about the systemd-devel mailing list