Programming language ray tracing benchmarks project
21–30 of 90 posts
Re: Programming language ray tracing benchmarks project
#22The most impressive result here is Lua -- not far behind C! LuaJIT is amazing. Good to see a few languages like Nim and Rust actually beating C for raw performance, too.
Re: Programming language ray tracing benchmarks project
#23Ordered by realtime, fastest to slowest for those like me who got annoyed by the scrolling up and down trying to compare: Rust (1.13.0-nightly) 1m32.392s Nim (0.14.2) 1m53.320s C 1m59.116s Julia (0.4.6) 2m01.166s Crystal (0.18.7) 2m01.735s C Double Precision 2m26.546s Java (1.7.0_111) 2m36.949s Nim Double Precision (0.14.2) 3m19.547s OCaml 3m59.597s Go 1.6 6m44.151s node.js (6.2.1) 7m59.041s node.js (5.7.1) 8m49.170s…
Re: Programming language ray tracing benchmarks project
#24Ordered by realtime, fastest to slowest for those like me who got annoyed by the scrolling up and down trying to compare: Rust (1.13.0-nightly) 1m32.392s Nim (0.14.2) 1m53.320s C 1m59.116s Julia (0.4.6) 2m01.166s Crystal (0.18.7) 2m01.735s C Double Precision 2m26.546s Java (1.7.0_111) 2m36.949s Nim Double Precision (0.14.2) 3m19.547s OCaml 3m59.597s Go 1.6 6m44.151s node.js (6.2.1) 7m59.041s node.js (5.7.1) 8m49.170s…
I wonder if the performance gap is attributable to some overhead in Go's function calls? I know Go passes parameters on the stack instead of via registers... Maybe it's due to passing struct copies instead of references (looks like the C version passes references)? Generally poor code generation?
Anyone else have ideas or care to profile?
EDIT: From my 2015 MBP, Go (version 1.12) is indeed quite a lot slower than C, but only if you're doing an optimized build `-03`:
tmp $ time ./gorb
real 1m15.128s
user 1m9.366s
sys 0m6.754s
tmp $ clang crb.c
tmp $ time ./a.out
real 1m13.041s
user 1m10.284s
sys 0m0.624s
tmp $ gcc crb.c -o crb -std=c11 -O3 -lm -D_XOPEN_SOURCE=600
tmp $ time ./crb
real 0m22.703s
user 0m22.550s
sys 0m0.073s
tmp $ clang crb.c -o crb -std=c11 -O3 -lm -D_XOPEN_SOURCE=600
tmp $ time ./crb
real 0m22.689s
user 0m22.564s
sys 0m0.060s
EDIT2: I re-modified the Go version (https://gist.github.com/weberc2/2aed4f8d3189d09067d564448367...) to pass references and that seems to put it on par with C (or I mistranslated, which is also likely): $ time ./gorb
real 0m19.282s
user 0m14.467s
sys 0m7.523sRe: Programming language ray tracing benchmarks project
#25Re: Programming language ray tracing benchmarks project
#26The most impressive result here is Lua -- not far behind C! LuaJIT is amazing. Good to see a few languages like Nim and Rust actually beating C for raw performance, too.
You should look again. Lua seems to be the slowest of the bunch.
Now I’m tempted to try speeding it up, there’s no way it should be behind Python...
Re: Programming language ray tracing benchmarks project
#27The most impressive result here is Lua -- not far behind C! LuaJIT is amazing. Good to see a few languages like Nim and Rust actually beating C for raw performance, too.
Re: Programming language ray tracing benchmarks project
#28...and then add SIMD.
Re: Programming language ray tracing benchmarks project
#29Ordered by realtime, fastest to slowest for those like me who got annoyed by the scrolling up and down trying to compare: Rust (1.13.0-nightly) 1m32.392s Nim (0.14.2) 1m53.320s C 1m59.116s Julia (0.4.6) 2m01.166s Crystal (0.18.7) 2m01.735s C Double Precision 2m26.546s Java (1.7.0_111) 2m36.949s Nim Double Precision (0.14.2) 3m19.547s OCaml 3m59.597s Go 1.6 6m44.151s node.js (6.2.1) 7m59.041s node.js (5.7.1) 8m49.170s…
I wouldn’t give much weight to those benchmark numbers at this point. Some of those language versions are quite out of date...
Re: Programming language ray tracing benchmarks project
#30> rustc 1.13.0-nightly what's an ancient version of rust. Interesting it is faster than C, though.