On 24/09/13 16:18, John Mija wrote:
Since a post in HN about a raytracer into a business card, a guy built
the implementation in Go:
https://groups.google.com/forum/#!topic/golang-nuts/mxYzHQSV3rw
The C++ version: https://gist.github.com/kid0m4n/6680629
The Go version: https://github.com/kid0m4n/gorays
Performance (2.2 Ghz Quad Core (2675QM), 16 GB RAM, OX 10.9, Go 1.1.2):
C++ version: 11.803 s
Go version: 28.883 s
* * *
It would be interesting if somebody with experience in Rust could
build the version in Rust to compare the speed.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev
I bit: https://github.com/huonw/card-trace
Summary: Clang 13.8s, GCC 17.9s, Rustc 17.9s.
(1.9GHz 3517U, 8 GB, linux. GCC: 4.8.1, Clang: 3.3, rustc: 18e3bcd
2013-09-23 23:46:05 -0700.)
I just did essentially a transliteration of the C++ into (reasonably
idiomatic) Rust, I imagine one could make it faster with some effort,
but that would be cheating (at least, it would then become a test of
*my* micro-optimisation ability, rather than that of the compilers). It
appears that clang vectorises/uses SSE directly more eagerly than either
gcc or rustc from some quick poking with perf.
(I don't have Go on this computer to compare; although I imagine the
only comparison of interest would be with gccgo, since "normal" go
doesn't optimise anywhere near as much as LLVM does.)
Huon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev