←back to thread

Zlib-rs is faster than C

(trifectatech.org)
341 points dochtman | 4 comments | | HN request time: 0.015s | source
Show context
johnisgood ◴[] No.43381735[source]
"faster than C" almost always boils down to different designs, implementations, algorithms, etc.

Perhaps it is faster than already-existing implementations, sure, but not "faster than C", and it is odd to make such claims.

replies(10): >>43381810 #>>43381813 #>>43381820 #>>43381959 #>>43382108 #>>43382124 #>>43382267 #>>43385171 #>>43386202 #>>43392542 #
pveierland ◴[] No.43385171[source]
One big part I've noticed when working in rust is that, because the compilation and analysis checks you're given are so much stronger than in C or C++, and because the ecosystem of crates is so easy to make use of, I'll generally be able to make use of more advanced algorithms and methods.

I'm currently working with ~150 dependencies in my current project which I know would be a major hurdle in previous C or C++ projects.

replies(1): >>43385258 #
1. ForTheKidz ◴[] No.43385258[source]
Everything you said is correct of course, but the idea of auditing 150 dependencies makes me feel ill. It's essentially impossible for a single person.
replies(3): >>43385294 #>>43385299 #>>43386883 #
2. steveklabnik ◴[] No.43385294[source]
This is why sharing code is so important; it doesn't fall on one person, but instead, on the overall community.

For example, cargo-vet and cargo-crev allow you to rely on others you trust to help audit dependencies.

3. pveierland ◴[] No.43385299[source]
Oh, absolutely. Software cannot scale without trust. No single person is capable of auditing their browser or operating system either.
4. maccard ◴[] No.43386883[source]
The effort is _roughly_ proportional - if you need to parse JSON in either language you can write it yourself or use an existing library. Both of those are the same amount of work in c++ and rust.