[Qt-interest] Poor performance of "setBackground()" API in QTableWidgetItem class in Qt 4.5.1

Stephen Jackson spjackson42 at gmail.com
Thu Jun 11 10:01:46 CEST 2009


On Thu, Jun 11, 2009 at 4:27 AM, Mark Pereira wrote:

>
> I have been using Qt 4.3.3 for a while and have recently moved to Qt4.5.1. I
> have noticed that the performance of the "setBackground()" API of
> QTableWidgetItem class has slowed down dramatically.
>
> I have attached a sample piece of code which can be used to reproduce this
> problem. In Qt 4.3.3. it takes around 407msec to complete setting the
> background, while in Qt 4.5.1 it takes 68,567msec for the same task. I ran
> this test on a Intel Core Duo PC (1.8 GHz) with 2 GB RAM.
>

I have run your test and this does not reproduce the problem on my system.

g++ 4.3.2, Ubuntu 8.10 (64 bit)

Running the test 5 times with each of two Qt versions gives the
following results.

Qt 4.4.3 msec: 297, 256, 225, 317, 221 [Average 263]
Qt 4.5.1 msec: 434, 279, 270, 340, 402 [Average 345]

Could it be that something else has changed in your environment, other
than the Qt version? (e.g. debug vs nodebug)

Stephen Jackson



More information about the Qt-interest-old mailing list