Revision ee0f3ff...

Go back to digest for 27th January 2013

Optimization in Development Tools

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

Add benchmark comparing different possible containers for the TypeRepo

This was discussed on IRC and I thought it might be interesting. Here
are the numbers for a RelWithDebInfo build on my machine:

RESULT : BenchHashes::typeRepo():"vector":
0.00012 msecs per iteration (total: 67, iterations: 524288)
RESULT : BenchHashes::typeRepo():"vector-raw":
0.00012 msecs per iteration (total: 66, iterations: 524288)
RESULT : BenchHashes::typeRepo():"qhash":
0.0011 msecs per iteration (total: 75, iterations: 65536)
RESULT : BenchHashes::typeRepo():"qmap":
0.0019 msecs per iteration (total: 64, iterations: 32768)
RESULT : BenchHashes::typeRepo():"unordered_map":
0.0018 msecs per iteration (total: 59, iterations: 32768)

So QHash is just one magnitude slower than QVector, and still quite
fast... We might try that out in the future for future proofing the
duchain type registration.

File Changes

Modified 2 files
  • /duchain/tests
  •   language/benchhashes.cpp
  •   language/benchhashes.h
2 files changed in total