Ubuntu 18.04 LTS also ships with the boot improvement

Mar 20, 2018 12:30 GMT  ·  By

If you plan on upgrading to the forthcoming Ubuntu 18.04 LTS (Bionic Beaver) operating system this spring, chances are your computer will boot a little faster thanks to the implementation of a stronger compression algorithm for the initial ramdisk.

Canonical's Balint Reczey recently proposed the implementation of LZ4 compression to Ubuntu's initramfs (initial ramdisk) instead of the older gzip compression used in previous releases of the wildly used operating system. LZ4 is a lossless data compression algorithm that offers extremely fast compression and decompression speed.

During some initial tests on an old laptop, the developer reports that the initramfs extraction time decreased from approximately 1.2 seconds to about 0.24 seconds. The creation of the initramfs also received a speed boost of 2-3 seconds, decreasing from roughly 24 seconds to about 21 seconds, despite of slightly bigger initramfs files.

LZ4 compression to be implemented by default in Ubuntu 18.10

While Ubuntu 18.04 LTS (Bionic Beaver) will be the first to ship with the LZ4 compression option for the initramfs, it won't be enabled by default. So you'll have to manually enable it if you want your Ubuntu computer to boot a bit faster than usual. Canonical plans to enable it by default in Ubuntu 18.10, due for release in October 2018.

"Base on the results I plan adding LZ4 compression support to initramfs-tools as requested in LP: #1488620 in the next days without setting it as default and I propose setting LZ4 as default for 18.10," said Balint Reczey, Software Engineer, Ubuntu Foundations at Canonical.

On the downside, it appears that the LZ4 compression algorithm makes slightly bigger initrd files, but the developer reports that this won't affect future Ubuntu releases due to update-manager's ability to remove old kernels to prevent the /boot directory from filling up with unwanted initramfs files and kernels.

Last week, another Canonical engineer proposed the implementation of Facebook's Zstd lossless compression algorithm to the dpkg and apt command-line package management systems, which would speed up new Ubuntu installation by about 10 percent with default configuration or up to 40 percent if eatmydata is involved.