2 ms·
"Not necessarily. As mentioned before, the Rust way of doing things generally leads to a lot of optimized stuff. Taking the vtable example -- Go code that I've
by jerf 12y ago
"Not necessarily. As mentioned before, the Rust way of doing things generally leads to a lot of optimized stuff. Taking the vtable example -- Go code that I've seen uses vtabley things everywhere (the stdlib is peppered with interface types). Using vtables isn't bad, but when you use it for stuff that could have been solved by static dispatch (for large codebases -- that can be everywhere), then it can become an issue."
Yes, but by definition, we're discussing optimized code here.
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=rust&data=u64q http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
Yeah yeah, benchmarks blah blah, but the point here is, compare with, oh, say, this:
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=perl&lang2=rust&data=u64q http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
As I said and will repeat without blinking, Rust will always be faster than Go (and the problem in the shootout Go beat Rust on is in my opinion certainly simply an unoptimized Rust implementation, no question), but language deltas of 2x or 3x in practice are dominated by algorithms and IO far more often than 50-100x. For all the long list of reasons that Rust is faster than Go, all of which are true, they add up to much less than developers are used to. Intuitively, when you hear "go is slower than Rust because vtables and bad optimization and GC and its pauses and interfaces" you probably mentally expect Go to be like 10 times slower, when instead it's 2-3.
This is relevant because I don't think Rust advocates should sell "speed!" too hard as the primary thing they have... C++ will pretty much forever be able to keep up on the raw speed front, especially in benchmarks. What it has is complexity management, at speed. But complexity management first.... Rust could probably take a straight-up 2x speed penalty over C++ and still write a renderer than ran faster than C++, because it'll be a better renderer.
- igouy 12y ago> unoptimized Rust implementation Scotty! We need more CORE[s] !"
- Manishearth 12y agoOh, I see what you mean now. I agree to the most part :)