Interesting post about how the author with the help of the Go community has got better performance than C++ version.

"After optimizations, the Go ray tracer was 8.4 % faster than a functionally equivalent C++ version when rendering a 4.2 MegaPixel image using a single thread. With multi-threading enabled, the performance gap widened to 76.2 % on a 8 Core machine."

https://kidoman.com/programming/go-getter.html

El 24/09/13 23:20, Kevin Ballard escribió:
I ran them myself. Incidentally, the Rust version is absurdly slow if I
don't specify an optimization level. Here's what I got:

Clang (-O3): 7.99s real
Go (improved version): 9.68s real
Go (original version): 16.73s real
Rust (--opt-level=3): 13.03s real

(I ran each case 3 times and took the median)

So if we discard the algorithmically-improved Go, then we get

1) C++: 7.99s
2) Rust: 13.02s
3) Go: 16.73s

I'm curious as to what difference using gccgo would make, but I didn't
try (as I don't have GCC).

-Kevin

On Sep 24, 2013, at 2:48 PM, Huon Wilson <dbau...@gmail.com
<mailto:dbau...@gmail.com>> wrote:

On 25/09/13 04:13, Tim Kuehn wrote:
To make it a "fair" fight, I converted the Go and C++ versions to
trace "Rust" instead. These are my results on my Macbook Pro:

=== RUST ===
$ rustc -O bin.rs <http://bin.rs/>
$ time ./bin > rrays.ppm

real0m14.472s
user0m14.102s
sys0m0.365s

=== GO ===
$ go build main.go
$ time ./main > grays.ppm

real0m13.928s
user0m13.914s
sys0m0.020s

=== C++ ===
$ gcc -O crays.cpp
$ time ./a.out > crays.ppm

real0m10.800s
user0m10.794s
sys0m0.005s

=== RANKINGS ===
1) C++ : 10.8s
2) Go   : 13.9s
3) Rust : 14.5s



This surprises me a lot (the fact that Go is (1) faster than Rust, (2)
it's only 20% slower than C++, compared to 150+% originally), so I
investigated, and found that the Go is "cheating" with an algorithmic
improvement:
https://github.com/kid0m4n/gorays/commit/249f229ba8c769c38d7dc018acfdf29cc86d6e43

If it's possible, could we re-run the benchmarks with the commit
before that?

Huon
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org <mailto:Rust-dev@mozilla.org>
https://mail.mozilla.org/listinfo/rust-dev



_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to