-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C implementation for addition to benchmark #53
Comments
Cool, I've added it to the makefile and run script. I found the Use Highbit one to be fastest. |
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 notifications@github.com 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 notifications@github.com wrote:
|
I offer a version written in C for inclusion in the benchmark:
https://gist.github.com/nkurz/5e49ba0ddb04e23de03f
I've only tested on Haswell under Linux, but results are good when compiled with gcc-4.8 -O2:
// 8981 LANGUAGE C 623
// 8981 LANGUAGE C++/clang 734
// 8981 LANGUAGE C++/gcc 755
I have tested, but I think the implementation should continue to perform well with larger graph sizes.
The text was updated successfully, but these errors were encountered: