7 ms·
I don't belive in this result! C slower than Rust in 11 times!!! Are they kidding?! http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=gcc&lang2=rus
by cyber1 10y ago
I don't belive in this result! C slower than Rust in 11 times!!! Are they kidding?!
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=gcc&lang2=rust http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan... -- in this benchmarks C in most cases faster than Rust, but only in few they have the same performance.
- Sean1708 10y agoCompiler optimisations can be very nuanced, especially in C. You might find that changing the code very slightly, or even just using a different combination of compiler options, can speed up the code a surprising amount. Edit: Looks like using -Ofast instead of -O3 makes a big difference: https://news.ycombinator.com/item?id=13634119 https://news.ycombinator.com/item?id=13634119
- bbatha 10y agoIn most of those benchmarks rust is slower because it lacks SIMD support, not because of compiler optimizations.
- kibwen 10y agoOr rather, Rust is slower on those because SIMD is currently only supported on nightly, and the benchmarks game chooses to use stable Rust exclusively.
- pjmlp 10y agoI also don't work with VS Release Candidates for production code, as such I think it is faire to use only stable Rust.
- dbaupp 10y agoFrom what I've seen, most of the Rust community agrees that using stable a perfectly fine choice; kibwen is offering context, not complaining.
- pjmlp 10y agoI agree with him, I express myself badly.
- igouy 10y agohttps://news.ycombinator.com/item?id=13636724 https://news.ycombinator.com/item?id=13636724 Offering context? ;-)
- dbaupp 10y agoThat is a slightly different thing: stable is a perfectly good choice, but one can still debate the fairness or not of being compared to C-with-language-extensions i.e. not standard C (a joke which I think you missed, in one of kibwen's replies).
- igouy 10y agoThere are places on the website that abbreviate to "C" or shorten to "programming language", but whenever practical it's more specific - "C gcc" & "programming language implementation".
- kibwen 10y agoIndeed, though I (perhaps optimistically) expect SIMD to be stabilized on Rust this year. :)
- igouy 10y ago1. Have those Rust programs already been rewritten to use SIMD and measured ? 2. How many years already has SIMD not supported on stable been posted as a response in these discussions ?