QHash vs. unordered_map

Aleix Pol aleixpol at kde.org
Thu Nov 22 01:10:12 UTC 2012


On Wed, Nov 21, 2012 at 8:15 PM, Milian Wolff <mail at milianw.de> wrote:

> Hey all,
>
> can you please share the numbers for a release build running the following
> test from KDevplatform:
>
> language/duchain/tests/itemrepositorytest.shell testStringHashPerformance
>
> See 7465cc39f13edc4a4e99cf033a5751c8339018e0 for my numbers. If people can
> confirm this, then I'll refactor our code to use QHash and drop the nasty
> ifdef code.
>
> Cheers
>
> PS: Looking at the usage of hash_map in KDevelop's cpp parser, I'd say that
> its just overdesigned and could also easily be using a QHash.
> --
> Milian Wolff
> mail at milianw.de
> http://milianw.de
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
>
kde-devel at thinktatil:~/build-kdevplatform $
language/duchain/tests/itemrepositorytest.shell testStringHashPerformance
********* Start testing of TestItemRepository *********
Config: Using QTest library 4.8.3, Qt 4.8.3
QDEBUG : TestItemRepository::initTestCase() KGlobal::locale::Warning your
global KLocale is being recreated with a valid main component instead of a
fake component, this usually means you tried to call i18n related functions
before your main component was created. You should not do that since it
most likely will not work
QWARN  : TestItemRepository::initTestCase() WARNING: deleting stale
lockfile
/home/kde-devel/.kde/share/apps/kdevplatform/sessions/{715bff77-e801-4131-b057-0bb445bbf729}/lock
PASS   : TestItemRepository::initTestCase()
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-100":
     0.084 msecs per iteration (total: 87, iterations: 1024)
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-1000":
     0.81 msecs per iteration (total: 52, iterations: 64)
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-10000":
     9.8 msecs per iteration (total: 79, iterations: 8)
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-100000":
     121 msecs per iteration (total: 121, iterations: 1)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-100":
     0.033 msecs per iteration (total: 69, iterations: 2048)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-1000":
     0.33 msecs per iteration (total: 86, iterations: 256)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-10000":
     3.4 msecs per iteration (total: 55, iterations: 16)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-100000":
     39 msecs per iteration (total: 79, iterations: 2)
PASS   : TestItemRepository::testStringHashPerformance()
PASS   : TestItemRepository::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of TestItemRepository *********
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121122/d73f3888/attachment.html>


More information about the KDevelop-devel mailing list