[Interest] QMap<int64_t> significantly slower than QMap<int32_t>

Konstantin Tokarev annulen at yandex.ru
Mon Sep 23 11:41:01 CEST 2013


23.09.2013, 12:27, "Mandeep Sandhu" <mandeepsandhu.chd at gmail.com>:
>> Here are my results (g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3, Intel core i7, 1.2GHz, 8 GB RAM).
>>
>> $ ./qtvsstl 10000000
>>
>> Timing insertion of 10000000 items...
>> QMap : 1737 msecs
>> QHash : 821 msecs
>> STL map : 5458 msecs
>>
>> Timing iteration over 10000000 items...
>> QMap : 156 msecs
>> QHash : 202 msecs
>> STL map : 173 msecs
>>
>> Timing removal of random item from 10000000 items...
>> Map : 0 msecs
>> Hash : 0 msecs
>> STL map : 0 msecs
>>
>> STL map seems to be the slowest for insertion.
>
> The above was with Qt 4.8.1.
>
> With Qt5.1.2, Qmap performance seems to worse (same as std::map's).
>
> $ ./qtvsstl 10000000
> Timing insertion of 10000000 items...
> QMap : 5492 msecs
> QHash : 1218 msecs
> STL map : 5408 msecs
>
> Timing iteration over 10000000 items...
> QMap : 593 msecs
> QHash : 443 msecs
> STL map : 120 msecs
>
> Timing removal of random item from 10000000 items...
> Map : 0 msecs
> Hash : 0 msecs
> STL map : 0 msecs
>
> Actually, everything's a little slower with Qt5. Is C++11 enabled by default? Could that be the cause of degraded performance?

Qt 5 uses RB tree in QMap


-- 
Regards,
Konstantin



More information about the Interest mailing list