Hacker News new | ask | show | jobs
by koziserek 3 days ago
Looks impressive.

can you avoid zstd?

exiting 'pure rust' breaks the deal for me when considering to include in my project.

1 comments

There does exist a pure Rust implementation of Zstandard [1] [2].

[1] https://docs.rs/libzstd-rs-sys/

[2] https://docs.rs/mzstd/

I've created a test implementation with mzstd.

Unfortunately the performance is much worse than with zstd.

Tested with compiled linux kernel 6.1.1:

- zstd: compress ~6s, uncompress ~6s

- mzstd: compress ~7s, uncompress ~8s (encrypted 33s)

mzstd seems to be very interesting. It is even faster than the C original. Maybe I'll replace zstd with mzstd.
No, mzstd is slower

Quick test using TurboBench [1]:

   C Size  ratio%      C MB/s    D MB/s Rank    Name            File

 66132683  31.20%      277.53   1217.35  33     mzstd 3         silesia.tar

 66217008  31.24%      295.08   1467.05  29     zstd 3          silesia.tar
Download TurboBench and test both yourself with your data:

[1] https://github.com/powturbo/TurboBench

Thanks for your comment. I've already made a test implementation with mzstd and saw that zar is slower with that. So I'll keep using zstd.