Optimisation possibilities: current, future and enhancements

Basile B. via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 25 22:50:52 PDT 2016


On Thursday, 25 August 2016 at 22:37:13 UTC, kinke wrote:
> On Thursday, 25 August 2016 at 18:15:47 UTC, Basile B. wrote:
> From my perspective, the problem with this example isn't missed 
> optimization potential. It's the code itself. Why waste 
> implementation efforts for such optimizations, if that would 
> only reward people writing such ugly code with an equal 
> performance to a more sane `2 * foo.foo()`? The latter is a) 
> shorter, b) also faster with optimizations turned off and c) 
> IMO simply clearer.

You're too focused on the example itself (Let's find an non 
trivial example, but then the asm generated would be longer). The 
point you miss is that it just *illustrates* what should happend 
when many calls to a pure const function are occur in a single 
sub program.


More information about the Digitalmars-d mailing list