3 ms·
I was recently surprised that idiomatic Go can be faster than idiomatic Rust: https://news.ycombinator.com/item?id=26463967 https://news.ycombinator.com/item?i
by hu3 6y ago
I was recently surprised that idiomatic Go can be faster than idiomatic Rust:
https://news.ycombinator.com/item?id=26463967 https://news.ycombinator.com/item?id=26463967
- GrayShade 6y agoI haven't read that article yet, but I wouldn't really call the simple Rust version idiomatic. Stdin::lines() incurs a string allocation for each line (fixing this takes three lines of source code), which can be quite significant. And garbage-collected languages will have faster allocation, so I'm not too surprised. Of course, I know who the author of that code is. I just wanted to point out that it's not such a trivial comparison to make.