|
|
|
|
|
by bjourne
3665 days ago
|
|
> Not much of an issue, really, and it proves nothing about rusts overhead except that you can't rely on autovectorization. Not much of an issue unless you actually need the performace ofcourse. Ime, simd intrinsics is everywhere in code optimized to run as quickly as possible on x86. That about half of The Benchmark Game's benchmarks uses sse proves that point. > Go ahead and fix it then. You've been telling me much the same. I already mentioned that the other benchmark you linked me to wasn't optimized. That requires investing a lot of time in understanding how Ruby's internals and especially its string objects works. I don't have that time. The LPathBench on the other hand is self-contained and updating it shouldn't be more than a few hours of work for a decent Rust programmer. |
|
My point is that the Benchmark Game is not representative of real world code. The website says as much. Because the benchmarks use sse everywhere does not mean that most code, even perf-sensitive code will use simd everywhere.
Again, if you need simd, use a nightly. There's little to no drawback there.
I fixed it up to run on modern rust (https://gist.github.com/Manishearth/5fc73c405641162f0712951c..., compile with cargo build --release), and the numbers I get are:
(Ranges are just what I got from 5 runs, nothing scientific)
Rust: 610-630
c: 706-716
c_fast: 919?
cpp_clang: 669-694
cpp_plain: 717-728
I'm on a new (i7, 16gb) Mac so I don't yet have g++ around (nor do I know how to obtain it without messing things up; I'm used to linux), everything here done with clang.
Of course, this isn't an indication that Rust is faster than C. But it is an indication that it can be just as fast, and a reinforcement of my point about microbenchmarks having large error bars.
Edit:
On my older x86 linux laptop (with gcc):
Rust: 844-987
c_fast: 808-860 (perhaps clang somehow made c_fast slower than c on the mac? shrug)
c: 982-1025
cpp_plain: 977-1019
cpp_gcc: 925-947
I think I've proven my point.