Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
C implementation for addition to benchmark #53
I offer a version written in C for inclusion in the benchmark:
I've only tested on Haswell under Linux, but results are good when compiled with gcc-4.8 -O2:
I have tested, but I think the implementation should continue to perform well with larger graph sizes.
It might be interesting to add the following x64 benchmarks to the writeup. These were done on a Haswell i7-4770 CPU @ 3.40GHz (Turbo Off, Hyperthreading Off) running Linux 3.13, which I think is a representative current generation desktop processor.
nate@haswell:~/git/LPATHBench$ make run-all
8981 LANGUAGE C++Cached 18
My main conclusions would be:
I feel the C/branchless implementation I did is well optimized for this processor. My guess would be that assembly tweaks might get it down to 500 ms, but probably not much more. It's fairly incredible to me that the much higher level languages are able to stay as close to this speed as they do.
I added them. I don't suppose you have a different D compiler handy? Dmd is
While language doesn't seem to matter, note that fast code was much easier
Still pretty impressive how fast the higher-level languages are though.
On 27 December 2014 at 09:01, nkurz firstname.lastname@example.org wrote:
I'm not sure. I'd guess there are more ways to do have poor performance in each language than there are to do it fast, and it will always be a debate as to which approach is most idiomatic. Also, I think that choice of which is fastest will depend on the target architecture and change with compiler/interpreter versions. It would be interesting to have many versions written in each language to show the spread of performance within that language for plausible implementations, and then plot with the overlaps.
I'm installing compilers to try this, and can easily try to install others. I started with gdc-4.8, but failed with the following error:
I didn't know if this was a version problem, something easy to change in the source, or a known incompatibility. I can try again if you suggest a fix.
But just tried ldc2, and indeed the results are among the fastest
While I've got you, one more language I'm unfamiliar with but had errors was Julia.
Do you know if this means I should move up or down in version? Or if there is an easy fix?
With the next benchmark I might take a more functional approach like this,
That gdc issue could be fixed either by updating gdc, or by removing all
I don't have much experience with Julia either; someone else submitted that
On 28 December 2014 at 05:39, nkurz email@example.com wrote: