AuburnSounds / gamut

Image encoding and decoding library for D. Detailed layout control. Experimental codec QOIX.
Boost Software License 1.0
40 stars 2 forks source link

Replace LZ4 with zstd? #4

Closed p0nce closed 2 years ago

p0nce commented 2 years ago

Comparison from https://github.com/inikep/lzbench

Compressor | encode |  decode | out size | ratio (lower = better)
lz4 1.9.2             737 MB/s   4448 MB/s   100880800    47.60
zstd 1.4.3 -5         104 MB/s    932 MB/s    63993747    30.19
xz 5.2.4 -0            24 MB/s     70 MB/s    62579435    29.53
xpack 2016-06-02 -6    43 MB/s   1086 MB/s    62213845    29.35
ucl_nrv2e 1.03 -9    2.13 MB/s    429 MB/s    69645134    32.86
tornado 0.6a -5        51 MB/s    195 MB/s    64129604    30.26
lzma 19.00 -0          34 MB/s     80 MB/s    64013917    30.20
lzlib 1.11 -0          36 MB/s     61 MB/s    63847386    30.12
lzham 1.0 -d26 -0      11 MB/s    271 MB/s    64089870    30.24
lzfse 2017-03-08       90 MB/s    934 MB/s    67624281    31.91
lizard 1.0 -45        17 MB/s    1810 MB/s    67317588    31.76
lizard 1.0 -29      2.07 MB/s    2697 MB/s    68694227    32.41
fastlzma2 1.0.1 -10 3.99 MB/s     105 MB/s    48666065    22.96
brieflz 1.2.0 -8    0.46 MB/s     473 MB/s    64912139    30.63

Probably worth it to go a bit slower at decompression, much slower at encode, and to compress more.

p0nce commented 2 years ago

https://github.com/jibsen/brieflz sounds one of the smallest libraries.

p0nce commented 2 years ago

Crush is public domain and small and relatively interesting. (EDIT: unacceptable memory usage)

p0nce commented 2 years ago

zstd still looks far more interesting than anything else..

p0nce commented 2 years ago

zstd kinda big. lz4 is still where it's at