[Issue 16513] Speed up TemplateInstance.findExistingInstance, hash by mangling

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Sep 20 04:02:58 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16513

--- Comment #4 from Martin Nowak <code at dawg.eu> ---
(In reply to uplink.coder from comment #2)
> Hash collisions will happen!
> We need a way to speed up those equals compares in rootObject.
> I'll look if I can find a good way to gradually remove the virtual calls.

This whole RootObject hashing/comparison is a kludge when we can cheaply
generate a unique string.

>   IsVariable!(Simulated_Object_966)
>   IsMemberVariable!(Simulated_Object_975)
>   isSomeFunction!(Simulated_Object_573)
> 
> Those SHOULD produce the same hash they work on the same types!

Yes right, only the arguments are part of the hash.

> I am of the impression that template-inlining can help here.

True for isSomeFunction and it does work, the other 2 take alias parameters
(via variadic arguments) and create one instance per object (w/ the same hash).

--


More information about the Digitalmars-d-bugs mailing list