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

Martin Nowak <c...@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |goober...@gmail.com,
                   |                            |uplink.co...@googlemail.com

--- Comment #1 from Martin Nowak <c...@dawg.eu> ---
It's the horrible hash that is causing the performance issue.
Arguments as widely different than

  genericIndexOf!(CPPMethods, ushort, int, uint, long, ulong)
  genericIndexOf!(VTable, ushort, int, uint, long, ulong)

produce the same hash.

>From the 88.3K lookups, 7900 have the hash 1 (one).

The test code that triggered the issue contains 1K instances of

  VariableDescriptor!(tonsofsimulatedobjects, SimulatedEntity,
"Simulated_Object_1063")
  VariableDescriptor!(tonsofsimulatedobjects, SimulatedEntity,
"Simulated_Object_1064")

and lots of instances like

  IsVariable!(Simulated_Object_963)
  IsMemberVariable!(Simulated_Object_973)
  isSomeFunction!(Simulated_Object_571)
  IsVariable!(Simulated_Object_964)
  IsMemberVariable!(Simulated_Object_974)
  isSomeFunction!(Simulated_Object_572)
  IsVariable!(Simulated_Object_966)
  IsMemberVariable!(Simulated_Object_975)
  isSomeFunction!(Simulated_Object_573)

all producing the same hash.
With such a crappy hash the behavior degrades back to the old linear search.

I'll try to replace this with the mangling suffix (.getIdent) instead which
should be both simpler and effective, given that all mangling bugs are fixed.

--

Reply via email to