cost of calling class function

Patrick Schluter via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 23 11:57:18 PST 2017


On Thursday, 23 February 2017 at 17:02:55 UTC, Johan Engelen 
wrote:
> On Thursday, 23 February 2017 at 16:25:34 UTC, Johan Engelen 
> wrote:
>> [...]
>
> We're in good company: both clang and gcc also do not 
> devirtualize the call when the loopcount is too large (when the 
> loop count is 4, the indirect calls are gone, when it is 160, 
> they are back).
>
> Btw, with PGO, the performance is 4 ms(direct call) vs 6 ms 
> (virtual call). Pathological, but still.
>
> I am submitting a DConf talk on optimization and the cost of D 
> idioms. This gave me some new ideas to present, thanks :)
>
> -Johan

Marking the method as @pure changes anything?


More information about the Digitalmars-d mailing list