So I feel a little sheepish now, as I tried the C++ code again with LTO turned
off, and it’s now slightly faster than the Rust version. I guess it’s a
performance regression that gets triggered by LTO in this specific case.
Here are the results I get now:
clang PerformanceTest.cpp dsp.cpp -std=c++11 -ffast-math -O3 -o PerformanceTest
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix
Iterations: 955
C results: 100,043,846 shorts per second.
Rust is still very competitive with 93M shorts/second, and I would hope to see
the gap narrowed or eliminated as the compiler & language continue to be
improved.
The code is also now available here if anyone is interested:
https://gist.github.com/learnopengles/004ff4eee75057ca006c
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev