Optimisation possibilities: current, future and enhancements
kinke via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 25 15:37:13 PDT 2016
On Thursday, 25 August 2016 at 18:15:47 UTC, Basile B. wrote:
> The problem here that the example is bad with too agressive
> optimizations because the CALLs are eliminated despite of no
> inlining.
>
> [...]
>
> int use(const(Foo) foo)
> {
> return foo.foo() + foo.foo();
> }
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.
More information about the Digitalmars-d
mailing list