Templates are slow.

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 8 06:31:47 PDT 2016


On Thursday, 8 September 2016 at 05:02:38 UTC, Stefan Koch wrote:
>
> If you are instantiating a template inside another template 
> think very hard about the reason, often you can "inline" the 
> template body of the inner template and get an instant speed 
> win right there.
> (Don't do this preemptively, ONLY when you know that this 
> template is a problem!)
>

What about functions in std.algorithm, like reduce, that have 
templates with multiple functions within them and the headline 
function will call private impl functions within them?


More information about the Digitalmars-d mailing list