How to have a reasonable relationship with your OSes.
It’s a necessary hassle ?! Or maybe it takes learning (getting used to it). But I really don’t want to do anything.
I have multiple Manjaro and arclinux-based distributions (eos, cachy) installed. I use them to compare DEs and test before they break. I take excessive backups and snapshots, but I don’t think about it, so I do it to repair the occasional breakdown.
By the way, I noticed that my main 5-year-old installation (cinnamon) takes a few extra seconds to boot. It doesn’t affect my actual use, but I was just looking into mkinitcpio.conf.
I added the following settings and it really made booting from grub faster. Lol. mkinitcpio -P
This has been default for a long time.
Have you neglected pacnews ?
This is setting the compression level.
Default is 3.
I would be flabbergasted if you got higher speeds from what is essentially double the compression (and then double the decompression).
I might often expect this to create losses … but it all depends on what kind of matches.
See also these tables;
When there are many long distance matches:
Method
Compression ratio
Compression speed
Decompression speed
zstd -1
5.065
284.8 MB/s
759.3 MB/s
zstd -5
5.826
124.9 MB/s
674.0 MB/s
zstd -10
6.504
29.5 MB/s
771.3 MB/s
zstd -1 --long
17.426
220.6 MB/s
1638.4 MB/s
zstd -5 --long
19.661
165.5 MB/s
1530.6 MB/s
zstd -10 --long
21.949
75.6 MB/s
1632.6 MB/s
And when there are few long distance matches:
Method
Compression ratio
Compression speed
Decompression speed
zstd -1
2.878
231.7 MB/s
594.4 MB/s
zstd -1 --long
2.929
106.5 MB/s
517.9 MB/s
zstd -5
3.274
77.1 MB/s
464.2 MB/s
zstd -5 --long
3.319
51.7 MB/s
371.9 MB/s
zstd -10
3.523
16.4 MB/s
489.2 MB/s
zstd -10 --long
3.566
16.2 MB/s
415.7 MB/s
Docs:
PS.
If you really care about speed … you might want to use --fast or --fast=# … these will really speed things up in exchange for a loss of some compression ratio.
Or … use lzop which is just faster.
(lz4 could get a mention here, but its speed is comparable to lzop, while having worse compression)
Note that that table is explicitly for when there are many long matches.
Thats the only reason it looks that way.
(maybe I should amend the post to reflect this - OK, did it)
Comparitvely they provide a second table when there are few long distance matches:
Method
Compression ratio
Compression speed
Decompression speed
zstd -1
2.878
231.7 MB/s
594.4 MB/s
zstd -1 --long
2.929
106.5 MB/s
517.9 MB/s
zstd -5
3.274
77.1 MB/s
464.2 MB/s
zstd -5 --long
3.319
51.7 MB/s
371.9 MB/s
zstd -10
3.523
16.4 MB/s
489.2 MB/s
zstd -10 --long
3.566
16.2 MB/s
415.7 MB/s
I dont know. But I’m guessing its well within most desktops for decompressing the kernel during boot. zstd has algorithms for extremely memory constrained environments - like in the hundreds of kb, so I’m just figuring in the case of Xgb linux boot … you are fine.
Its more a general ‘this will use more RAM’.
I still say most folks would get the most boosts from lzop if they care most about decompression speed.
Or heck - you can set no compression if space is of no concern. 0 decompression.
Normally, pacnew is automatically detected by the hook, so I don’t think it’s likely that it’s overlooked, but you may be right.I am occasionally senile.
I’ve been using this script for about a year now. Thank you. @Ste74
2021-03-22 14:21 mkinitcpio.conf_orgin << just garbage
According to my notes from 6 months ago about boot times.
In my case, this seems to have reduced the time by about 50 seconds since then.
From selecting grub menu and hitting enter, to the time the desktop screen appears.
About 29 seconds.
Amazing.
I could write more of a response to both of these, but its all roughly covered by mentioning the drop-in that I use. This takes about no effort, and wont be bothered by a pacnew (whether this is good or bad may be arguable).
I forgot i actually customized the default hooks (mainly autodetect and systemd) so i guess i am already quite optimized, beside on a ssd. So for me if i play with the compression it will make maximum half of a second difference.
Here are my hooks
I prefer to read and understand what is going on because I like having my system under my control instead of following the herd-mentality consenus or ChatGPT
# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used for Linux ≥ 5.9 and gzip compression is used for Linux < 5.9.
# Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
#akf
COMPRESSION=cat
The inititrd will not be compressed while it is created.
But while it is stored in its place btrfs will compress it.
When booting, btrfs will decompress everything on the fly.
slow disk, fast processor: → use high compression (4-8)
fast disk, slow processor: → use default compression (3)
fast disk, very slow processor → use low compression (1-3)
fast disk, fast processor: → use what you want (9)
slow disk, slow processor: → upgrade system
Compression ratio is ca. 2:1 over all files on my computers