I've been compressing my kernels with xz for years, it was certainly the smallest option when I picked it then. They're 8MB each with the firmware and drivers baked in - no modules
Announcement
Collapse
No announcement yet.
Ubuntu Moving Ahead With Compressing Their Kernel Image Using LZ4
Collapse
X
-
Originally posted by FireBurn View PostI've been compressing my kernels with xz for years, it was certainly the smallest option when I picked it then. They're 8MB each with the firmware and drivers baked in - no modules
Way to go, Dimitri John Ledkov! I remember you from the Ubuntu mailing list. One of the few progressives left at Canonical, so it's nice to see something you do finally not be blocked by grumpy people.
- Likes 2
Comment
-
According to this page : https://github.com/facebook/zstd
Decompress speed:
lz4: 4220 MB/s
gzip-1: 440 MB/s
zstd-1: 1360 MB/s
So even gzip-1 should be good enough unless you have NVMe drive that can do 1GB/s +
Personally I would rather save the space than getting a fraction of a second increase in speed...
zstd-1 would be optimal though. (Edit: from candidates in that table)
Edit1:
Lets take a hypothetical image that is 20MB in size:
Compress with zstd-1:
6.93 MB
Compress with lz4:
9.52 MB
Compress with gzip-1:
7.29 MB
Load time:
zstd-1:
5.099 ms
lz4:
2.255 ms
gzip-1:
16.571 ms
Saving 14ms during boot (only on NVMe) feels kind of optimizing the wrong thing ...
Edit2:
Ok so those values are for a i9900k-wara-wara-wara
So lets say my crappy laptop is 10x slower than mentioned machine.(Crappy laptop probably doesn't even have SDD, in which case then (decompress speed/compression ratio) is king like Compartmentalisation rightly pointed out)
Now the load times (assume SSD for crappy laptop so disk io doesn't break the math)
Load time:
zstd-1:
50.09 ms
lz4:
22.55 ms
gzip-1:
160.571 ms
So now it is 138.02 ms faster at boot time. Still not even close to a second ...Last edited by Raka555; 06 June 2019, 04:38 PM.
- Likes 1
Comment
-
Originally posted by Raka555 View PostAccording to this page : https://github.com/facebook/zstd
Decompress speed:
lz4: 4220 MB/s
gzip-1: 440 MB/s
zstd-1: 1360 MB/s
So even gzip-1 should be good enough unless you have NVMe drive that can do 1GB/s +
Personally I would rather save the space than getting a fraction of a second increase in speed...
zstd-1 would be optimal though.
- Likes 3
Comment
-
Originally posted by Raka555 View PostAccording to this page : https://github.com/facebook/zstd
Decompress speed:
lz4: 4220 MB/s
gzip-1: 440 MB/s
zstd-1: 1360 MB/s
So even gzip-1 should be good enough unless you have NVMe drive that can do 1GB/s +
Personally I would rather save the space than getting a fraction of a second increase in speed...
zstd-1 would be optimal though.
In a serious way, you missed that it goes from disk to memory. So you can have something that has 50% compression level, right? Then you only need to read 50% of the size from the disk, which is why compressing the initramfs means it gets loaded faster than using a plain image. It'd be on those NVMe disks that you have less need to compress it, but you'd really want to compress it on a slow HDD.
- Likes 1
Comment
-
-
Originally posted by Compartmentalisation View Post
In a serious way, you missed that it goes from disk to memory. So you can have something that has 50% compression level, right? Then you only need to read 50% of the size from the disk, which is why compressing the initramfs means it gets loaded faster than using a plain image. It'd be on those NVMe disks that you have less need to compress it, but you'd really want to compress it on a slow HDD.
- Likes 1
Comment
-
Now I'm wondering what the kernel time from systemd-analyze mean in the command output on my laptop:
Startup finished in 3.371s (kernel) + 11.628s (userspace) = 14.999s
Is the time counted from when the kernel decompressor starts or is the time counted after the kernel is decompressed?
Is systemd-analyze tool able to show a difference between these compression / decompression algorithms?
Comment
Comment