erofs-utils: mkfs: reduce default dict size for LZMA
authorGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 12 Feb 2025 19:15:45 +0000 (03:15 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 13 Feb 2025 02:31:15 +0000 (10:31 +0800)
commitd180c898bd0842eaeb54ca0073e6f444bdae8c40
treeca0f6e31bde918079b4a29c60e301c296fec28bd
parentbc8ec19a4ed741c9b457387dcba2b647e819b16d
erofs-utils: mkfs: reduce default dict size for LZMA

Change the default dictionary size to 4 times the pcluster size.
This will halve the LZMA internal dictionary size to a maximum of
4MiB per LZMA worker (one worker per CPU in the kernel implementation
unless the module parameter `lzma_streams=` is given.)

It has a very slight impact on the final image sizes, yet users can
always use `-zlzma,dictsize=` to specify a custom value.

  _________________________________________________________________________
 |______ Testset _____|_______ Vanilla _________|_________ After __________| Command Line
 |  CoreOS            |   741978112 (708 MiB)   |   742293504 (708 MiB)    | -zlzma,6 -Eall-fragments,fragdedupe=inode -C8192
 |                    |   687501312 (656 MiB)   |   687652864 (656 MiB)    | -zlzma,6 -Eall-fragments,fragdedupe=inode -C131072
 |____________________|__ 658485248 (628 MiB) __|__ 658698240 (629 MiB)  __| -zlzma,6 -Eall-fragments,fragdedupe=inode -C1048576
 |  Fedora KIWI       |  2974957568 (2838 MiB)  |  2977394688 (2840 MiB)   | -zlzma,6 -Eall-fragments,fragdedupe=inode -C8192
 |                    |  2684272640 (2560 MiB)  |  2686750720 (2563 MiB)   | -zlzma,6 -Eall-fragments,fragdedupe=inode -C131072
 |____________________|_ 2550800384 (2433 MiB) _|_ 2553278464 (2435 MiB) __| -zlzma,6 -Eall-fragments,fragdedupe=inode -C1048576
 |  AOSP system       |   432562176 (413 MiB)   |   432738304 (413 MiB)    | -zlzma,6 -Eall-fragments,fragdedupe=inode -C8192
 |  partition         |   393277440 (376 MiB)   |   393351168 (376 MiB)    | -zlzma,6 -Eall-fragments,fragdedupe=inode -C131072
 |____________________|__ 379260928 (362 MiB) __|__ 379285504 (362 MiB)  __| -zlzma,6 -Eall-fragments,fragdedupe=inode -C1048576

Link: https://lore.kernel.org/r/20250212191545.580768-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
lib/compressor_liblzma.c