Compression test
· openbsd
Vaguely inspired by Testing Compression Algorithms, I decided to run a similar test on OpenBSD, just to see which of the options available to me were better.
Results
file | algorithm | size (MB) | time (s) | decomp (s) |
---|---|---|---|---|
archive.tar | 571M | |||
archive.tar.gz | gzip | 570M | 3.42 | |
archive.tar.bz2 | bzip2 | 508M | 70.71 | |
archive.tar.xz | xz | 483M | 59.37 | |
archive.tar.zst | zstd | 503M | 3.27 |
That’s wierd.
Method
Similar to my inspiration, I created a tar backup and compressed it to the various formats.
$ uname -a OpenBSD x395.holsta.dk 7.7 GENERIC.MP#615 amd64 $ sysctl hw.{model,version,ncpuonline,physmem} hw.model=AMD Ryzen 7 PRO 3700U w/ Radeon Vega Mobile Gfx hw.version=ThinkPad X395 hw.ncpuonline=4 hw.physmem=16740098048 $ pkg_info | egrep '(bzip2|xz|zstd)' bzip2-1.0.8p0 block-sorting file compressor, unencumbered xz-5.6.4 library and tools for XZ and LZMA compressed files zstd-1.5.7 zstandard fast real-time compression algorithm