Ubuntu Moving Ahead With Compressing Their Kernel Image Using LZ4
For the past year Ubuntu developers have been talking of using LZ4 compression by default rather than Gzip for their kernel initramfs image. Using LZ4 yields a slightly larger file size but with quicker decompression/extraction speeds compared to Gzip. They seem to now be making that changeover for Ubuntu 19.10.
Ubuntu developer Dimitri John Ledkov who has long been involved in this effort commented this week on the Ubuntu mailing list with an update:
Zstd patches have not made it into the upstream kernel yet.Expect this for Ubuntu 19.10 to give it time for testing and tweaking ahead of Ubuntu 20.04 LTS.
As used by mkinitramfs:
- lz4 is faster to compress than gzip
- lz4 is blazingly fast to decompress
- lzma is dog slow to compress and decompress, but is tiny
- lz4 size weight over gzip is marginal (14%) but imho worth the improved boot time & initrd creation time
- xz is potentially even slower and even smaller than lzma
In places where size is an absolute premium (tiny embedded iot devices) and performance is irrelevant, xz or lzma should be used.
In all other places, our performance profile is in favor of lz4.
Imho that includes the kernel image itself, thus we should consider switching:
- initramfs tools to default to lz4
- livecd-rootfs to default to lz4
- kernels to compress kernel image with lz4
- grub to include lz4 support
I shall proceed with changing the defaults on the above to improve our responsiveness experience on installer, cloud, core and classic devices. If our firstboot & subsequent boot speed degrades or disk space becomes a concern, we can look into tweaking these changes further.