←back to thread

Zlib-rs is faster than C

(trifectatech.org)
341 points dochtman | 10 comments | | HN request time: 1.29s | source | bottom
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 #
1. qweqwe14 ◴[] No.43381813[source]
The fact that it's faster than the C implementation that surely had more time and effort put into it doesn't look good for C here.
replies(3): >>43381819 #>>43382282 #>>43385271 #
2. johnisgood ◴[] No.43381819[source]
It says absolutely nothing about the programming language though.
replies(2): >>43382007 #>>43392496 #
3. acdha ◴[] No.43382007[source]
Doesn’t it say something if Rust programmers routinely feel more comfortable making aggressive optimizations and have more time to do so? We maintain code for longer than the time taken to write the first version and not having to pay as much ongoing overhead cost is worth something.
4. vkou ◴[] No.43382282[source]
I think you'll find that if you re-write an application, feature-for-feature, without changing its language, the re-written version will be faster.
replies(1): >>43383356 #
5. renewiltord ◴[] No.43383356[source]
This is known as the Second System Effect: where Great Rewrites always succeed in making a more performant thing.
replies(1): >>43386989 #
6. jandrewrogers ◴[] No.43385271[source]
C++ surpassed C performance decades ago. While C still has some lingering cachet from its history of being “fast”, most software engineers have not worked at a time when it was actually true. C has never been that amenable to scalable optimization, due mostly to very limited abstractions and compile-time codegen.
7. cb321 ◴[] No.43386989{3}[source]
I am not sure if the semantics have drifted over the decades to what you say, but this seems not quite right according to wikipedia: https://en.wikipedia.org/wiki/Second-system_effect

EDIT: but I do agree that starting greenfield from an old code base is often a path towards performance.

replies(1): >>43395103 #
8. jason-johnson ◴[] No.43392496[source]
How can it not? Experts in C taking longer to make a slower and less safe implementation than experts in Rust? It's not conclusive but it most certainly says something about the language.
replies(1): >>43402334 #
9. renewiltord ◴[] No.43395103{4}[source]
Just having a laugh, mate, but it is nice to have the truth posted as well.
10. johnisgood ◴[] No.43402334{3}[source]
> Experts in C taking longer to make a slower and less safe implementation than experts in Rust?

How do you know this exactly?