[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#976054: initramfs-tools: [RFC] Compress initramfs file with zstd



* Hideki Yamane [Sun Nov 29, 2020 at 10:06:21AM +0900]:

> Now initramfs files are compressed with gzip
> But we can use other compression, i.e. LZO, LZ4 and ZSTD.
> Then which one is the best?

> * compression ratio
>    ZSTD > GZIP > LZO > LZ4

> * decompression speed
>    LZ4 > LZO = ZSTD > GZIP

> I suggest to choose ZSTD, instead of GZIP since
>  - better compression ratio than current GZIP
>  - also better decompresion speed than current GZIP

[...]

> Yes, 59MB initramfs file becomes 40MB (2/3)! plus bonus, better decompression speed.

Thanks for bringing this up.

Do we have any numbers for where xz resides in terms of
decompression speed? Is it enough to just decompress the
files in userspace for getting numbers, or is the kernel doing
something special™ to be kept in mind?

JFTR, some further numbers regarding file sizes:

| # file netboot.initrd*
| netboot.initrd.gzip: gzip compressed data, last modified: Wed Dec  2 10:13:21 2020, from Unix, original size 135559168
| netboot.initrd.lz4:  LZ4 compressed data (v0.1-v0.9)
| netboot.initrd.lzop: lzop compressed data - version 1.030, LZO1X-1, os: Unix
| netboot.initrd.xz:   XZ compressed data
| netboot.initrd.zstd: Zstandard compressed data (v0.8+), Dictionary ID: None
| # ls -lah netboot.initrd*
| -rw-r--r-- 1 root root 43M Dec  2 10:13 netboot.initrd.gzip
| -rw-r--r-- 1 root root 51M Dec  2 10:25 netboot.initrd.lz4
| -rw-r--r-- 1 root root 60M Dec  2 10:24 netboot.initrd.lzop
| -rw-r--r-- 1 root root 29M Dec  2 10:17 netboot.initrd.xz
| -rw-r--r-- 1 root root 32M Dec  2 10:16 netboot.initrd.zstd

regards
-mika-

Attachment: signature.asc
Description: Digital signature


Reply to: