damentz / liquorix-package

Liquorix Debian Package
https://liquorix.net
GNU General Public License v2.0
285 stars 23 forks source link

Updating ZSTD to latest release in Liquorix #175

Closed anonyco closed 3 months ago

anonyco commented 3 months ago

The current ZSTD version in Liquorix is currently the same as in the upstream kernel—1.5.2. Zstd has made numerous leaps and jumps in performance over the past few years. Some highlights from their release notes:

damentz commented 3 months ago

Do you have a link to the updated kernel implementation, preferably a patch or branch I can merge?

Rongronggg9 commented 3 months ago

IMHO these snippets are just cherry-picking, and even the changelog itself from ZSTD did so. I can hardly see any potential that it may speed BTRFS up.

Among the 1.5.4 release notes: [...]

Before the table, it says: The 1.5.4 release improves IO performance of zstd CLI...

So it is irrelevant to libzstd.

Among the v1.5.5 release notes: [...]

Before the table, it says: The row-hash match finder introduced in version 1.5.0 for levels 5-12 has been improved in version 1.5.5... _The following scenario measures compression speed of ZSTD_compressStream at level 9..._

BTRFS users hardly use such expensive levels (5-12) and the optimization is irrelevant to lower levels. Meanwhile, the compression of BTRFS is done chunk-by-chunk (max 128KiB). According to the table, it is suspicious that a chunk as large as 128KiB would see a notable gain. As for small chunks, BTRFS will find the overhead is just too high and stop compressing them.

Among the v1.5.6 release notes. This is particularly interesting for speeding up btrfs: [...]

Before the citation, it says: _...libzstd introduces the new parameter ZSTD_c_targetCBlockSize, ... Activating this feature incurs a cost, both runtime (equivalent to -2% speed at level 8) and a slight compression efficiency decrease (<0.1%), but offers some interesting latency reduction, notably beneficial in areas with less powerful network infrastructure._

So it is an opt-in feature and is not a silver bullet. Just bumping the version will not take any advantage of it. Meanwhile, I can hardly see SSDs (even HDDs - typical seek time needs just 4-15ms!) are comparable to "areas with less powerful network infrastructure".

damentz commented 3 months ago

@Rongronggg9 thanks for the analysis, it looks like users won't notice the benefit. Not to mention, Liquorix defaults to LZ4 wherever possible to minimize compute time of compression.

Closing this out.