The officially official Devuan Forum!

You are not logged in.

#1 2026-06-28 17:29:11

Xaver
Member
Registered: 2025-12-28
Posts: 5  

Refractasnapshot – Comparison of different Compression Algorithms

When I was creating an iso-image of my new Refracta based system, I have noticed, that zstd -22 and zstd -19 deliver the same results. Obviously the zstd ultra mode does not work properly within Refractasnapshot. This inspired me to do some testing of different compression options.
Here are my results:

Total size of the system on qemu hd:
/ 4,09 GB + /home/ 289 MB = 4,37 GB

xz:        1572 MB    (-4.1% to zstd -19 | -15,4% to zstd -1)
xz -b 262144:    1540 MB       (-2.0% to xz)
xz -b 524288:    1512 MB       (-3.8% to xz)
xz -b 1048576:    1486 MB       (-5.5% to xz)

xz -Xbcj x86    1548 MB    (-1.5% to xz)

zstd -22:    1639 MB    ('zstd --ultra -22' does not work)
zstd -19:    1639 MB    (-11.8% to zstd -1)
zstd -15:    1652 MB    (-11.1% to zstd -1)
zstd -8:    1727 MB    (-7.0%  to zstd -1)
zstd -3:    1800 MB    (-3.1%  to zstd -1)
zstd -1:    1858 MB       (-17.2%  to lz4)

lz4:        2245 MB    (+20,8% to zstd -1)

Relative compression speed according to Allan Jude (2017):
[https://openzfs.org/w/images/b/b3/03-Op … in_ZFS.pdf]
zstd -19 = 1x    | zstd --ultra -22 = 0.58X
zstd -15 = 2.3x  | zstd -8 = 16.1x
zstd -3  = 59.1x | zstd -1 = 101.5x
lz4 = 172.3x

According to Northon Torga (2024) xz and zstd -19 have a similar compression speed:
[https://ntorga.com/gzip-bzip2-xz-zstd-7z-brotli-or-lz4/]
zstd -19 = 1x  |  xz = 0.96x

Decompression speed of xz is about 5 times slower than zstd:
xz = ~0,18x  |  zstd = 1x  |  lz4 = ~ 3.2x

Depending on hardware and kind of files the actual results may differ.

Last edited by Xaver (2026-07-02 21:24:19)

Offline

#2 2026-07-02 16:35:45

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,941  

Re: Refractasnapshot – Comparison of different Compression Algorithms

Thanks for that info. I made a note to myself to try a few different settings when I next make some live-isos. Faster builds and faster boots would be nice.

Offline

#3 Today 15:34:30

Xaver
Member
Registered: 2025-12-28
Posts: 5  

Re: Refractasnapshot – Comparison of different Compression Algorithms

Now I have integrated these insights in /etc/refractasnaoshot.conf
The compression sections of my refractasnaoshot.conf now looks like this:

-----------------------------
[...]

# Uncomment one of the lines below to use xz or zstd compression for smaller iso.

# small and slow # relative size of the iso-image
#mksq_opt="-comp xz"    # (-4.1% to zstd -19 | -15,4% to zstd -1)
#mksq_opt="-comp xz -b 262144"     # (-2.0% to xz)
#mksq_opt="-comp xz -b 524288"     # (-3.8% to xz)
#mksq_opt="-comp xz -b 1048576"     # (-5.5% to xz)

# smaller and slower:
#mksq_opt="-comp xz -Xbcj x86"     # (-1.5% to xz)

# not as small but faster
#mksq_opt="-comp zstd -Xcompression-level 22"     # (= -19 | --ultra ?)
#mksq_opt="-comp zstd -Xcompression-level 19"     # (-11.8% to zstd -1)
mksq_opt="-comp zstd -Xcompression-level 15"     # (-11.1% to zstd -1)
#mksq_opt="-comp zstd -Xcompression-level 8"     # (-7.0% to zstd -1)
#mksq_opt="-comp zstd -Xcompression-level 3"     # (-3.1% to zstd -1)
#mksq_opt="-comp zstd -Xcompression-level 1"     # (-17.2% to lz4)

#mksq_opt="-comp lz4"     # (+20,8% to zstd -1)

[...]

Last edited by Xaver (Today 15:34:58)

Offline

Board footer