lzma dictionary size

After some research about all the options for LZMA which affects compression ratio and memory consumption, I foud that Dictionary size is the most important setting. For Slax 6 rc7, all squashfs filesystems are generated using 8MB dictionary (regardless the block size in squashfs). If the dictionary size is decreased to 1MB, the compression is exactly the same but memory usage decreases as well.

In LZMA SDK, the following describes the Dictionary size

d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB) The maximum value for dictionary size is 1 GB = 2^30 bytes. Dictionary size is calculated as DictionarySize = 2^N bytes. For decompressing file compressed by LZMA method with dictionary size D = 2^N you need about D bytes of memory (RAM).

Simply said, the bigger the dictionary is, the better may be the compression, but the more RAM will be needed to decompress the data.

Regarding these facts, Junjiro Okajima modified LZMA patch for squashfs to add -lzmadic option. Thanks to this modification, one can use his own prefered dictionary size instead of the default. Moreover, the dictionary size now defaults to the block size used for squashfs, instead of the 8MB constant like before.

So, now if mksquashfs is called with -bs 256KB, then 256KB is used for both squashfs block size and LZMA dictionary. To use different dictionary size, you will have to specify -lzmadic YYY after the -bs parameter.

New rc8 will be build using the new mksquashfs.

None
A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".
Origianl story:

Valid XHTML 1.0 Strict