Optimization in Development Tools
Use a QHash instead of a fixed-size QVector for the type registry.
While this is of course slower, the impact is imo negleglible. The
benchmark shows that the TypeSystem becomes ~20% slower, but that
is still nothing in total compared to other parts of KDevelop which
are actually much slower. Thus, limiting the API in such a drastic
way (only up to N types) is imo not worth it. Instead we can take
the small performance impact and improve the performance elsewhere :)
Also note that to encounter a slowdown of ~1s one would need to call
the TypeSystem functions approx. 45 million times. Setting a counter
breakpoint on TypeSystem::create shows that it's being called less
than one million times when loading my biggest KDevelop session. So
yeah, I think we can safely ignore this time impact and classify the
existing code as a premature optimization.