←back to thread

Zlib-rs is faster than C

(trifectatech.org)
341 points dochtman | 1 comments | | HN request time: 1.303s | source
Show context
cb321 ◴[] No.43382021[source]
I think this may not be a very high bar. zippy in Nim claims to be about 1.5x to 2.0x faster than zlib: https://github.com/guzba/zippy I think there are also faster zlib's around in C than the standard install one, such as https://github.com/ebiggers/libdeflate (EDIT: also mentioned elsethread https://news.ycombinator.com/item?id=43381768 by mananaysiempre)

zlib itself seems pretty antiquated/outdated these days, but it does remain popular, even as a basis for newer parallel-friendly formats such as https://www.htslib.org/doc/bgzip.html

replies(4): >>43382328 #>>43382506 #>>43382513 #>>43382516 #
hinkley ◴[] No.43382328[source]
Zlib is unapologetically written to be portable rather than fast. It is absolutely no wonder that a Rust implementation would be faster. It runs on a pathetically small number of systems by contrast. This is not a dig at Rust, it’s an acknowledgement of how many systems exist out there, once you include embedded, automotive, aerospace, telecom, industrial control systems, and mainframes.

Richard Hipp denounces claims that SQLite is the widest-used piece of code in the world and offers zlib as a candidate for that title, which I believe he is entirely correct about. I’ve been consciously using it for almost thirty years, and for a few years before that without knowing I was.

replies(1): >>43386914 #
1. maccard ◴[] No.43386914[source]
Except this comparison isn’t against zlib, it’s against zlib-ng [0]. The readme states:

> The result is a better performing and easier to maintain zlib-ng.

So they’re comparing a first pass rewrite against a variation of zlib designed for performance

[0] https://github.com/zlib-ng/zlib-ng