Compiler performance with my ridiculous Binderoo code

safety0ff via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 11 09:04:24 PST 2016


On Sunday, 11 December 2016 at 16:26:29 UTC, Ethan Watson wrote:
>
> At the very least, I now have an idea of which parts of the 
> compiler I'm taxing and can attempt to write around that. But 
> I'm also tempted to go in and optimise those parts of the 
> compiler.

Have a look at this issue: 
https://issues.dlang.org/show_bug.cgi?id=16513

In a nutshell:
Dmd puts template instances in an AA using a terrible hash 
function.
When looking for a match it does an expensive comparison for each 
collision.

The hash function is easily fixed but it does not obviate the 
expensive comparison, so it trades hashing time for comparison 
time. Therefore the performance impact of fixing it is unclear.
Martin Nowak is suggesting that using the mangled name is the way 
forward.


More information about the Digitalmars-d mailing list