CTFE Status

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 24 09:04:01 PST 2017


On Tuesday, 24 January 2017 at 15:48:19 UTC, Nordlöw wrote:
> On Tuesday, 24 January 2017 at 15:33:37 UTC, Stefan Koch wrote:
>> The lookup time is one issue but not the most important,
>> The instanciation of a template is a non-trivial operation 
>> within the compiler.
>> Type-deduction ast rewriting expression expansion
>> all of that takes time and a huge chunk at that.
>
> Interesting. Is that the major cause of high memory usage in 
> DMD?
>
>> Also binary code needs to be generated and that code is 
>> generated for every instance regardless of how similar they 
>> are.
>
> Thanks.

I would have to investigate the specific case.
It's also because the recursive nature of templates that you end 
up with +100_000 instances

It those numbers even small allocations have a huge impact.


More information about the Digitalmars-d mailing list