News for hackers. Stuff that matters.
Re:Comparing Parallel Rust and C++ by sdan on Thursday November 07, 2019 @03:54AM (#21471552)
TLDR: Most of the time C++ with GCC was best.
Re:Comparing Parallel Rust and C++ by galangalalgol on Thursday November 07, 2019 @04:37AM (#21471751)
Were you even looking at the same article? Rust was always better at intruction level parralellism and gcc was usually best at cache depending greatly on which i5 xeon was used. Clang was slways the worst.my main takeaway was that they are all three roughly identical and that small processor differences dominated the results.
Re:Comparing Parallel Rust and C++ by gpderetta on Thursday November 07, 2019 @07:05AM (#21472419)
ILP is not the correct metric, total runtime is (I was confused as well initially, but it is well explained in the article). the initial rust code had higher ILP simply because it has to execute more code for the bound checks. The C++ code stalls waiting for memory, while rust can fill up those bubbles with the checks (and that's why the checks do not cause slowdown initially). But as the code gets progressively optimized, the stalls are removed and the the C++ code can match the rust ILP, but at this point rust needs to execute more code and get penalized leading to an higher runtime. After the bounds checks are removed from the rust code, both implementations converge to the same ILP and runtime.
Re:Comparing Parallel Rust and C++ by fluffy87 on Thursday November 07, 2019 @04:47AM (#21471801)
Yeah, there were differences, but these were peanuts. Using two different versions of GCC will givenyou similar differences.
Re:Comparing Parallel Rust and C++ by gpderetta on Thursday November 07, 2019 @05:18AM (#21471940)
yes, you can see from the assembly listings in the final stages, that most of the differences were due to very minor code changes, due to details in the optimization passes and not really to language differences.
Re:Comparing Parallel Rust and C++ by Someone on Thursday November 07, 2019 @04:12PM (#21477299)
"Clang was always the worst”

Were you even looking at the same article? :-)

I thought the same as you, until I looked at the results for the "Mid-range laptop CPU with 4 physical cores and 8 hardware threads.”

There, clang does best in multi-core for v4 through v7. That made me think that, possibly, the default set of LLVM optimization transformation passes in clang is (better) optimised for Apple’s main audience: mobile.

Also: why are the fastest run on the “4.3 GHz Mid-range desktop CPU” slower than the equivalent ones on the “3.4 GHz Mid-range laptop CPU”?

Re:Comparing Parallel Rust and C++ by maeln on Thursday November 07, 2019 @04:23AM (#21471687)
Important to mention though: The difference was most of the time very slim.
Re:Comparing Parallel Rust and C++ by foota on Thursday November 07, 2019 @04:13AM (#21471639)
Was it? Seemed to swap between rustc and gcc to me.
Re:Comparing Parallel Rust and C++ by vihren on Thursday November 07, 2019 @04:22AM (#21471682)
It seems that when they squeeze all possible optimizations, GCC was a bit faster, but for the not so optimized code GCC and rustc seem very comparable.
Re:Comparing Parallel Rust and C++ by tiborsaas on Thursday November 07, 2019 @07:16AM (#21472485)
My TLDR: don't base your choice on performance if you have to pick between Rust or C++