A few numbers on allocation in dmd

Avrina avrina12309412342 at gmail.com
Thu Jul 9 12:29:57 UTC 2020


On Tuesday, 30 June 2020 at 18:18:32 UTC, Andrei Alexandrescu 
wrote:
> 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.

Can you post the project? If not, is there a similar one? I don't 
know of many big open source projects, especially ones that eat 
over 16 GB of memory.


More information about the Digitalmars-d mailing list