luci-mod-system/zram: replace deflate with zstd
authorRui Salvaterra <rsalvaterra@gmail.com>
Tue, 2 Mar 2021 09:31:22 +0000 (09:31 +0000)
committerRui Salvaterra <rsalvaterra@gmail.com>
Sun, 14 Mar 2021 12:24:15 +0000 (12:24 +0000)
Deflate is just too slow for zram. Replace it with zstd, which is much faster at
similar compression ratios.

As a side note, this is an ugly hack. We're hard-coding compression algorithms
which might not be available in the system. The availability should be parsed
from /sys/block/zram0/comp_algorithm.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js

index 2e087f5f4cc761f5ade3bfdb0ab4fe1f6d2069c3..14a15052ea06d1f4fae8729e1c3beab14f85ec64 100644 (file)
@@ -194,7 +194,7 @@ return view.extend({
                        o.default     = 'lzo';
                        o.value('lzo', 'lzo');
                        o.value('lz4', 'lz4');
-                       o.value('deflate', 'deflate');
+                       o.value('zstd', 'zstd');
 
                        o = s.taboption('zram', form.Value, 'zram_comp_streams', _('ZRam Compression Streams'), _('Number of parallel threads used for compression'));
                        o.optional    = true;