5 Mar 2012 08:06
Oddities with --lzma2 options
I played with lzma2 options and find two curious things.
First, start with something simple as reference (everything tested with
xz-5.0.3)
xz -vv -8e < coreutils-8.15.tar >/dev/null
xz: Filter
chain: --lzma2=dict=32MiB,lc=3,lp=0,pb=2,mode=normal,nice=273,mf=bt4,depth=5
12
xz: 370 MiB of memory is required. The limit is 17592186044416 MiB.
xz: Decompression will need 33 MiB of memory.
100 % 4832.6 KiB / 44.2 MiB = 0.107 361 KiB/s 2:05
Then the goal of the game is :
- to remove -8e so the instruction could be applied on different files size
with less memory required when possible
- still achieve the small as possible result (no more than 1% excess than
the maximum compression)
I tried using
xz -vv --lzma2=dict=$(du -sk coreutils-8.15.tar | awk '{ printf "%dKiB", $1
* 3 / 4 }'),nice=273,depth=512 < coreutils-8.15.tar >/dev/null
xz: Filter
chain: --lzma2=dict=33993KiB,lc=3,lp=0,pb=2,mode=normal,nice=273,mf=bt4,dept
h=512
xz: 381 MiB of memory is required. The limit is 17592186044416 MiB.
xz: Decompression will need 34 MiB of memory.
100 % 4833.4 KiB / 44.2 MiB = 0.107 358 KiB/s 2:06
That way to set lzma2 option only loose 0.8 KiB here and should work with
various size to be compressed.
(Continue reading)
RSS Feed