QHash vs. unordered_map

Mateusz Loskot mateusz at loskot.net
Thu Nov 22 00:06:21 UTC 2012


On 21 November 2012 19:15, 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.
>

$ ./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
PASS   : TestItemRepository::initTestCase()
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-100":
     0.031 msecs per iteration (total: 64, iterations: 2048)
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-1000":
     0.30 msecs per iteration (total: 77, iterations: 256)
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-10000":
     3.1 msecs per iteration (total: 51, iterations: 16)
RESULT :
TestItemRepository::testStringHashPerformance():"unordered_map-100000":
     55 msecs per iteration (total: 55, iterations: 1)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-100":
     0.023 msecs per iteration (total: 95, iterations: 4096)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-1000":
     0.22 msecs per iteration (total: 57, iterations: 256)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-10000":
     2.3 msecs per iteration (total: 75, iterations: 32)
RESULT : TestItemRepository::testStringHashPerformance():"qhash-100000":
     31 msecs per iteration (total: 63, iterations: 2)
PASS   : TestItemRepository::testStringHashPerformance()
PASS   : TestItemRepository::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of TestItemRepository *********

$ uname -a
Linux dog 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
GNU/Linux


Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121122/ecf8089a/attachment.html>


More information about the KDevelop-devel mailing list