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

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Mon Sep 23 12:45:42 CEST 2013


On Mon, Sep 23, 2013 at 3:58 PM, Philippe <philwave at gmail.com> wrote:

> **
> I was told the QMap implementation was changed from Qt 4 to 5, to improve
> performances... I guess some other tests give different results?...
>

I had a look at the commit logs. The commit that introduced this change
states that it's done so that one can later add custom allocators. Here's
an excerpt:

<snip>

The rewrite now uses a red-black tree, and all allocations
and tree operations happen in the cpp file. This will allow
us to introduce custom allocation schemes in later versions
of Qt.

</snip>

As for performance, the commit itself mentions that this change increases
insert/lookup times by 10-30%. Though in my tests, it was much slower.

-mandeep



>
> Philippe
>
> On Mon, 23 Sep 2013 15:15:37 +0530
> Mandeep Sandhu <mandeepsandhu.chd at gmail.com> wrote:
>
>
> > 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
>>
>
> Ah! That explains similar performance of QMap with std::map (though
> iteration is slower than std::map).
>
> But why was RB tree used when it doesn't as well as the previous skiplist
> based impl?
>
> -mandeep
>
>
>
>>
>> --
>> Regards,
>> Konstantin
>>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130923/3a020cf8/attachment.html>


More information about the Interest mailing list