The worst Phobos template (in binderoo)
Stefan Koch via Digitalmars-d
digitalmars-d at puremagic.com
Wed Sep 14 13:24:13 PDT 2016
Hi Guys,
I recently had a closer look at the templates that cost the most
time to instantiate in the frontend.
and there is one clear winner.
FullyQualified name from std.traits.
It takes a whooping 500 milliseconds(on my test-case) for it's
semantic phase.
this is because this template is recursive and because it
instantiates std.format.format which is on fourth place for slow
templates.
The functionality can be implemented with a __trait and that
implementation would be 500 times faster.
I am going to submit a PR soon.
However I cannot guarantee that the newly introduces trait work
the same in all cases.
As templates can behave surprisingly sometimes.
I would like to see users of fullyQualifiedName because apart
from binderoo code which seems to work, I have none.
More information about the Digitalmars-d
mailing list