A few numbers on allocation in dmd

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Tue Jun 30 18:18:32 UTC 2020


On 6/29/20 9:56 PM, Bruce Carneal wrote:
> 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 don't know, maybe Stefan would. Anyway, I attach one more file in the 
format:

total_bytes total_objects object_size type_name

The top offenders are about the same, but now the top 2 are much closer 
to each other.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sorted-with-totals.log
Type: text/x-log
Size: 11438 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20200630/f8d4bc39/attachment-0001.bin>


More information about the Digitalmars-d mailing list