Templates are slow.

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 8 22:28:28 PDT 2016


On Friday, 9 September 2016 at 01:38:40 UTC, deadalnix wrote:
> On Thursday, 8 September 2016 at 20:10:01 UTC, Stefan Koch 
> wrote:
>> generating separate object files for each template 
>> instanciation is and then only re-generating on change will 
>> only be effective if they do not change much.
>> From one build to the next.
>>
>
> You'd have tens of thousands of file and a big io problem.

I already thought about that.
The Idea is to stuff the object-code of all templates in one-file 
with a bit a meta-data.
make a do a hash lookup at instanciation.
And write the cached code in of the instanciation is found.

I agree, file I/O would kill any speed win many times over!



More information about the Digitalmars-d mailing list