News for hackers. Stuff that matters.
Re:Rust is now overall faster than C in benchmarks by wuxb on Monday January 04, 2021 @03:54AM (#25629001)
Just took a quick peek at the binary-trees C code. Why using openmp while the others don't? why use recursive functions? The C implementation is not correctly optimized. People just paid more attention to Rust and other languages. Rust can be as fast as C, but "faster" is really misleading. BTW, I use clang all the time since it's better than GCC.
Re:Rust is now overall faster than C in benchmarks by Tade0 on Monday January 04, 2021 @06:33AM (#25630023)
It seems that someone simply tacked openmp on without checking if it actually increases performance in this case - which is unusual, because I remember a course in college, part of which was a project aiming to teach the student that openmp is not a silver bullet and should be used only when it actually helps.
Re:Rust is now overall faster than C in benchmarks by JZerf on Monday January 04, 2021 @11:29PM (#25642121)
I submitted the C binary-trees program. I did check to see if OpenMP increased the performance and it most certainly does. Just looking at the CPU and clock time usage on https://benchmarksgame-team.pages.debian.net/benchmarksgame/... you can see that the clock time used is about one third of the CPU time that was used.
Re:Rust is now overall faster than C in benchmarks by igouy on Monday January 04, 2021 @03:00PM (#25637034)
How do you know that this is not one of those cases when openmp actually helps?
Re:Rust is now overall faster than C in benchmarks by JZerf on Monday January 04, 2021 @11:24PM (#25642095)
You're probably referring to the C program I submitted.

OpenMP is only available for C, C++, and Fortran so that is why most programs won't use it. However most of the other programming languages have their own ways for doing multi-threading and many of the programs for this benchmark do make use of them.

The rules at https://benchmarksgame-team.pages.debian.net/benchmarksgame/... request that submitters use the same algorithms as existing programs and I try to follow that rule. I believe all the binary-trees programs are using recursive functions so naturally I did the same to avoid breaking the rule about using different algorithms.