[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH v2 2/2] libdpkg: compress_lzma(): decrease default compression level



Hi,

Guillem Jover wrote:
>> diff --git a/lib/dpkg/compression-backend.c b/lib/dpkg/compression-backend.c
>> index 8f0c055..4b4c9c3 100644
>> --- a/lib/dpkg/compression-backend.c
>> +++ b/lib/dpkg/compression-backend.c
>> @@ -25,7 +25,7 @@
>>  
>>  static const char default_gz_compression = '9';
>>  static const char default_bz2_compression = '9';
>> -static const char default_lzma_compression = '9';
>> +static const char default_lzma_compression = '\0';
>>  
>>  static void fd_fd_filter(int fd_in, int fd_out, const char *desc,
>>  	const char *file, const char *cmd, const char *argfmt, ...)
>
> 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).

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.

Regards,
Jonathan

[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).


Reply to: