I wonder if I should use lzop or lz4 instead of the default gzip?
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
Which one would you recommend? My system is installed on BTRFS if that would make any difference.
Don’t know. zstd is not among those options in mkinitcpio.conf. Maybe it can be added to it. I really don’t know. I read a little bit about lzof and lz4. They seem to be a bit faster in compressing but the images produced are slightly larger in size…
yeah, i chose zstd when merging my mkinitcpio.conf and the .pacnew. But i’m not sure what is “the best” option. The speed depends on the CPU and number of cores as far as i remember… there is a another thread where this got discussed.
In case your device is encrypted, decrypt and mount your luks partition (e. g. /dev/sda2); otherwise leave out the decryption part and use /dev/sda2 instead of /dev/mapper/crypt:
But you’re not wrong, bzip2 and lzma are superseded by faster algos with better compression ratio. Gzip, xz, lz4 and zstd are valid and useful alternatives.
That said, XZ in my opinion only makes sense if you want to squeeze out a few KB/MB of free space. It’s rather slow both in compression and in decompression.
lz4 or zstd. Depends on the exact options and of course your hardware.
I use zstd -15 as a good compromise.
Somewhere I have a little script that logs total and cpu time, and file size for zstd and xz, might post it some day (I don’t have it on this computer).
(and there’s always “uncompressed” but I’m not sure if it’s really faster than e.g. lz4)
Thanks for the reply and explanation!
This machine got a AMD Ryzen 7 4800U. So if I were to use zstd -15, where do I need to make the change?
I know that I need to read up on these stuff and perhaps at the end of the day the difference is in order of some hundreds of a second but it is just nice to know that you can speed up things a bit when possible.