niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
508 stars 79 forks source link

Some rust optimizations: should make the implementation and compilation similar to the C one #20

Closed gauteh closed 2 years ago

gauteh commented 2 years ago

fixes #12.

niklas-heer commented 2 years ago

Hi @gauteh 👋

Thank you very much for your contribution. Unfortunately, this change has merge conflicts. This is due to my rework of the repo to use earthly. Do fix the merge conflict it seems like you only have to disregard the changes to the comparison.py since this script doesn't exist any more. It's all managed in the Earthfile now.

niklas-heer commented 2 years ago

Also on another note, these are the new results: plot

So, I don't know if Rust needs optimizations any more 😅

gauteh commented 2 years ago

Nice :D That looks good. I've updated the PR. Changing the target-cpu and using a f32 is a significantly faster. Using fold over for doesn't really make a difference, but maybe its a bit more idiomatic. Would be interesting to see if this PR makes a difference on the new charts!

workingjubilee commented 2 years ago

https://github.com/niklas-heer/speed-comparison/pull/24 proposes to make the C and C++ computations more precise, instead, by using C's "doubles" (IEEE754 binary64 on most machines, AKA f64).

niklas-heer commented 2 years ago

Thank you very much for your contribution @gauteh :+1: Also thank you very much for the discussion and input @workingjubilee :slightly_smiling_face:

gauteh commented 2 years ago

Thanks 🙂!

man. 10. okt. 2022, 16:00 skrev Niklas Heer @.***>:

Thank you very much for your contribution @gauteh https://github.com/gauteh 👍 Also thank you very much for the discussion and input @workingjubilee https://github.com/workingjubilee 🙂

— Reply to this email directly, view it on GitHub https://github.com/niklas-heer/speed-comparison/pull/20#issuecomment-1273358842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN36YYHZACVH6LQRUXR6DWCQOOPANCNFSM6AAAAAAQ3ARPB4 . You are receiving this because you were mentioned.Message ID: @.***>