Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Carel Combrink
Perhaps this article might be of use in this discussion: http://woboq.com/blog/qmap_qhash_benchmark.html ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest

Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Mandeep Sandhu
On Mon, Sep 23, 2013 at 3:58 PM, Philippe 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

Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Philippe
I was told the QMap implementation was changed from Qt 4 to 5, to improve performances... I guess some other tests give different results?... Philippe On Mon, 23 Sep 2013 15:15:37 +0530 Mandeep Sandhu wrote: > Actually, everything's a little slower with Qt5. Is C++11 enabled by default? > Cou

Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Mandeep Sandhu
> 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 i

Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Konstantin Tokarev
23.09.2013, 12:27, "Mandeep Sandhu" : >> Here are my results (g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3, Intel core >> i7, 1.2GHz, 8 GB RAM). >> >> $ ./qtvsstl 1000 >> >> Timing insertion of 1000 items... >> QMap : 1737 msecs >> QHash : 821 msecs >> STL map : 5458 msecs >> >> Timing iterat

Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Mandeep Sandhu
> Here are my results (g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3, Intel core > i7, 1.2GHz, 8 GB RAM). > > $ ./qtvsstl 1000 > > Timing insertion of 1000 items... > QMap : 1737 msecs > QHash : 821 msecs > STL map : 5458 msecs > > Timing iteration over 1000 items... > QMap : 156 msecs > QHa

Re: [Interest] QMap significantly slower than QMap

2013-09-23 Thread Mandeep Sandhu
On Sun, Sep 22, 2013 at 4:42 PM, Konstantin Tokarev wrote: > > 22.09.2013, 13:24, "Etienne Sandré-Chardonnal" : > > I don't, I have very only strong conviction from tests on a big large > program. I was hoping that someone had an idea about the cause... Would > this help to make one? > > I did a q

Re: [Interest] QMap significantly slower than QMap

2013-09-22 Thread Konstantin Tokarev
22.09.2013, 13:24, "Etienne Sandré-Chardonnal" : > I don't, I have very only strong conviction from tests on a big large > program. I was hoping that someone had an idea about the cause... Would this > help to make one? > I did a quick test : inserting 1000 items in a QMap and > QMap using

Re: [Interest] QMap significantly slower than QMap

2013-09-22 Thread Etienne Sandré-Chardonnal
I don't, I have very only strong conviction from tests on a big large program. I was hoping that someone had an idea about the cause... Would this help to make one? I did a quick test : inserting 1000 items in a QMap and QMap using rand() for key and value, measuring the delay with QDateTime::

Re: [Interest] QMap significantly slower than QMap

2013-09-21 Thread Giuseppe D'Angelo
On 21 September 2013 14:47, Etienne Sandré-Chardonnal wrote: > I'm experiencing this issue : a 64-bit int QMap slows my app comparing to a > 32-bit int one. I'm compiling with GCC-MinGW64, so a 64-bit compiler. > Shouldn't it be as fast? The QMap is not very large (maybe 1000 elements) > and I hav

[Interest] QMap significantly slower than QMap

2013-09-21 Thread Etienne Sandré-Chardonnal
Hi, I'm experiencing this issue : a 64-bit int QMap slows my app comparing to a 32-bit int one. I'm compiling with GCC-MinGW64, so a 64-bit compiler. Shouldn't it be as fast? The QMap is not very large (maybe 1000 elements) and I have much bigger structures in my app, so the memory size should not