A few numbers on allocation in dmd

Bruce Carneal bcarneal at gmail.com
Tue Jun 30 01:56:31 UTC 2020


On Tuesday, 30 June 2020 at 01:18:48 UTC, Andrei Alexandrescu 
wrote:
> I got a few numbers on what types dmd allocates the most while 
> compiling a large project.

[snip of interesting description of how the numbers were obtained]

>
> Looking at the top offenders:
>
> 42634177 dmd.mtype.TypeIdentifier
> 20452075 dmd.dtemplate.TemplateInstance
> 20202329 dmd.dsymbol.DsymbolTable
> 18783004 dmd.declaration.AliasDeclaration
> 18224199 dmd.dsymbol.ScopeDsymbol
> 18172133 dmd.mtype.Parameter
> 14124126 dmd.expression.IntegerExp
>
> The drop-off is fast, as expected, more than 2x from #1 to #2, 
> and 3x from #1 to #7. That means any work that improves on 
> TypeIdentifier is likely to greatly relieve the number of 
> allocation calls. Here are a few thoughts on possible 
> improvements:
>
[snip of improvement descriptions]

Do you know, or can you easily find out how many of these type 
identifiers might be eliminated by the improvements Stefan Koch 
and others have talked about recently?  I'm not an expert but 
from those discussions it sounded like a great deal of type 
identifier generation activity was a by-product of compiler 
implementation; suffix appending recursions where tighter 
iterative forms might suffice.








More information about the Digitalmars-d mailing list