Re:Comparing Pythagorean triples in C++, D, and Rust
by atilaneves on Monday December 31, 2018 @11:03AM
(#18795095)
Update: The Rust versions can all be made to run faster with a simple edit. I've updated the timings and edited some of the text.
[ Parent
| on HN ]
Re:Comparing Pythagorean triples in C++, D, and Rust
by vlovich123 on Monday December 31, 2018 @02:12PM
(#18796312)
Not mentioned in the post but I'm assuming you're using O0 for "debug"? It may be worthwhile to reconsider as O0 is now considered to be a tool for compiler authors & regular people should use -Og (or opt-level 1 for Rust) as a way of generating builds that have performance optimizations applied that don't impact debugging.
Re:Comparing Pythagorean triples in C++, D, and Rust
by ZirconiumX on Monday December 31, 2018 @09:16PM
(#18798499)
I've usually found -Og to inline functions or optimise out variables I needed to investigate. It's happened often enough that I just use printf in release mode.
Re:Comparing Pythagorean triples in C++, D, and Rust
by dralley on Monday December 31, 2018 @11:15AM
(#18795182)
This was a really good and worthwhile analysis, thanks!
Despite the changes people are submitting, it's good to know about these different gotchas. And there may be one or two actual compiler enhancements that could be made here also.