Help with Template Code

Max Samukha samukha at voliacable.com
Sun Apr 1 09:48:10 PDT 2007


On Sun, 1 Apr 2007 11:43:58 -0400, "Jarrett Billingsley"
<kb3ctd2 at yahoo.com> wrote:

>"Max Samukha" <samukha at voliacable.com> wrote in message 
>news:dopu039g3u5dtb0ubovm8c7ach304bdbb7 at 4ax.com...
>> Note that the mixin ctor is slower then manually coded one because of
>> the loop. To improve performance, you could skip the struct
>> initialization:
>
>That loop is unrolled at compile time since it's iterating over a tuple. 

I thought it should, too. But when tested on Windows with dmd 1.010,
the tuple version is significantly slower. I'm still not sure why.

>It'll be just as fast as writing the initialization out line-by-line.  But 
>using =void is another nice optimization :) 
>



More information about the Digitalmars-d-learn mailing list