Templates do maybe not need to be that slow (no promises)

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 10 07:50:33 PDT 2016


On Friday, 9 September 2016 at 07:56:04 UTC, Stefan Koch wrote:
>
> There is a direct linear relationship between the generated 
> code and  the template body.
> So If the range of change inside the template body can be 
> linked to the changed range in the binray and we link this to 
> the template parameters we can produce a pure function that can 
> give us the change in the binary code when provided with the 
> template parameters.
> And the need to rerun the instanciation and code-gen is reduced 
> to just the changed sections.
>
> I am not yet sure if this is viable to implement.

I think I have found a way to avoid subtree-comparisons for the 
most part and speed them up significantly for the rest.
At the expense of limiting the number of compile-time entities 
(types, expressions ... anything)  to a maximum 2^(28) (When 
using a 64bit id)



More information about the Digitalmars-d mailing list