A few numbers on allocation in dmd

NilsLankila NilsLankila at gmx.us
Wed Jul 1 08:26:05 UTC 2020


On Tuesday, 30 June 2020 at 01:54:54 UTC, rikki cattermole wrote:
> On 30/06/2020 1:18 PM, Andrei Alexandrescu wrote:
>> * Any work that reduces the number of TypeIdentifier, 
>> TemplateInstance, etc. objects in the first place would help 
>> quite a bit.
>
> One strategy that is used with identifiers in dmd is to use a 
> table lookup of strings to them. By making them unique, it 
> makes them faster overall.
>
> If we could strip out the SLOC out of the TypeIdentifier class, 
> this strategy could be used for it.

idPool is already used but only to guarantee identifiers 
uniqueness (i.e reject dups). I think that a second idpool could 
be used, this one to share those who has not be be unique, just 
like dparse's StringCache/internString()


More information about the Digitalmars-d mailing list