You think Rust (or any of them) is slow ?  Try raytracing by hand. :)

On Tue, Sep 24, 2013 at 5:20 PM, Kevin Ballard <ke...@sb.org> wrote:

> 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> 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
> $ time ./bin > rrays.ppm
>
>  real 0m14.472s
> user 0m14.102s
> sys 0m0.365s
>
>  === GO ===
>  $ go build main.go
> $ time ./main > grays.ppm
>
>  real 0m13.928s
> user 0m13.914s
> sys 0m0.020s
>
>  === C++ ===
>  $ gcc -O crays.cpp
> $ time ./a.out > crays.ppm
>
>  real 0m10.800s
> user 0m10.794s
> sys 0m0.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
> https://mail.mozilla.org/listinfo/rust-dev
>
>
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
>


-- 
-Thad
Thad on Freebase.com <http://www.freebase.com/view/en/thad_guidry>
Thad on LinkedIn <http://www.linkedin.com/in/thadguidry/>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to