On Thursday, 26 July 2012 at 18:59:14 UTC, Jonathan M Davis wrote:
Clearly -O is where the big runtime speed difference is at between dmd and gdc, which _is_ a bit obvious, but I'm surprised that -inline had no differences, since dmd is generally accused at being poor at inlining. That probably just indicates that it's a frontend issue (which I suppose makes sense when I think
about it).

GDC probably performs inlining by default on -O2/-O3, just like LDC does.

Also note that for the -release case (any performance measurements without it are most probably not worth it due to all the extra _d_invariant, etc. calls), -inline seems to increase the runtime of the DMD-produced executable by 10%. For inlining, you inevitably have to rely on heuristics, and there will always be cases where it slows down execution (worst case: the slight improvement in code size causes cache thrashing in a hot path), but 10% in a fairly standard application seems to be quite a lot.

David

Reply via email to