Revision 63328cb...

Go back to digest for 28th July 2013

Optimization in Development Tools

Milian Wolff committed changes in [kdevplatform] /duchain/types:

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.

REVIEW: 111643

File Changes

Modified 2 files
  • /duchain/types
  •   language/typeregister.cpp
  •   language/typeregister.h
2 files changed in total