Re: [PATCH v2 2/2] libdpkg: compress_lzma(): decrease default compression level
On Tue, 2010-02-02 at 15:13:10 -0600, Jonathan Nieder wrote:
> Guillem Jover wrote:
> > I've not yet changed the default for the lzma compressor, but I'd like
> > to set it explicitly instead of relying on the library/command, I
> > guess 6 or 7 should be fine? (the lzma tool default to 7, xz to 6).
>
> Yes. 6 should be fine. With lzma provided by xz [1], that uses about
> 8 MiB of resident memory on the decompressing end; with lzma provided
> by lzma, that uses about 4 MiB to decompress. Unfortunately, the
> pre-set compression levels have different meanings for the two
> versions (the gaps between 7 and 8 and 9 were too high, so upstream
> fixed it).
Thanks for the explanation. This change is in the tree, the level for
both .lzma and .xz formats is 6 now.
> If you want to distinguish the two versions, try “lzma --robot --version”:
> lzma provided by xz will say
>
> XZ_VERSION=(some integer)
> LIBLZMA_VERSION=(some other integer)
>
> whereas lzma from the current lzma package will give a one-line
> complaint and exit with status 1.
>
> The patch '[PATCH v2 2/4] dpkg-deb: set a memory usage limit for
> lzma -d' instead uses the heuristic that “lzma --version” provided by
> xz starts with "xz", but that is not guaranteed to hold forever.
Right, I'd rather not do this kind of heuristic, it tends to break
badly when the ouput changes for whatever reason, and it implies an
additional call to the tool. Also dpkg is now using xz for both .xz and
.lzma formats. I don't think there's much point in requiring both tools
when one is supposed to supercede the other and can handle both formats.
And when we are going to transition to the shared library anyway.
> [1] Since lzma is pseudo-essential, there is no way I know of without
> using diversions for two implementations to coexist, so for now we
> just don’t ship the lzma symlink from XZ Utils. But:
>
> - As soon as lzma is not essential any more, I will be packaging
> xz-lzma for experimental, and for unstable soon after if that goes
> well;
> - The xz-utils README.Debian encourages users to create that symlink
> themselves if they want it on their own $PATH.
> Thus I would prefer if dpkg still works without problems after a
> 'ln -s /usr/bin/xz /usr/local/bin/lzma' (or ~/bin/lzma).
Well this seems will just work fine, as lzma is just not going to be
used. :)
regards,
guillem
Reply to: