[PyQt] setLabel problem

Vicent Mas uvep at ono.com
Fri Jun 22 10:57:34 BST 2007


Hi,

I've found a performance problem in the QHeader.setLabel method. I've an 
application that makes an intensive use of this method. It is written 
in PyQt 3.15 (I know, I should move to PyQt4, but I'm too busy at the 
moment :( When I run the application in PyQt 3.17 the performance falls 
drastically in some operations. Profiling the application shows that 
the problem seems to be in the QHeader.setLabel method. You can see the 
profiling results in the attached file. I also attach a very rough 
benchmark that shows the problem when you run it using both versions of 
PyQt.

IIRC PyQt 3.15 was installed with sip 4.3.2 whereas PyQt 3.17 has been 
installed with sip 4.6.

Any help will be appreciated.

-- 
::

	Share what you know, learn what you don't

-------------- next part --------------
Profile for PyQt 3.17
---------------------
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on tyrrell, Qt-Version
>>> import pstats
>>> p = pstats.Stats('VTProfile_317')
>>> p.sort_stats('time').print_stats(10)
Wed Jun 20 15:13:32 2007    VTProfile_317

         205990 function calls (204929 primitive calls) in 49.884 CPU seconds

   Ordered by: internal time
   List reduced from 1268 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   28.457   28.457   48.046   48.046 :0(exec_loop)
    10004   17.253    0.002   17.904    0.002 :0(setLabel)
        1    0.521    0.521    1.133    1.133 C:\...\vtapp.py:104(__init__)
    75437    0.435    0.000    0.435    0.000 :0(time)
     9470    0.371    0.000    1.652    0.000 C:\...\vtTables\hpViewport.py:302(eventFilter)
    10719    0.285    0.000    1.180    0.000 :0(eventFilter)
     2753    0.190    0.000    0.896    0.000 C:\...\vtTables\hpViewport.py:144(paintCell)
     2788    0.164    0.000    0.500    0.000 :0(paintCell)
       10    0.156    0.016   18.476    1.848 C:\...\vtTables\hpViewport.py:253(tableFault)
     2753    0.134    0.000    0.336    0.000 C:\...\vtWidgets\vtTableItem.py:65(paint)


<pstats.Stats instance at 0x092F6E68>

Profile for PyQt 3.15
---------------------
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
tyrrell, Qt-Version
>>> import pstats
>>> p = pstats.Stats('VTProfile_315')
>>> p.sort_stats('time').print_stats(10)
Fri Jun 22 07:27:40 2007    VTProfile_315

         242928 function calls (242551 primitive calls) in 30.699 CPU seconds

   Ordered by: internal time
   List reduced from 1395 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   25.252   25.252   28.777   28.777 :0(exec_loop)
    23004    0.616    0.000    0.616    0.000 :0(setLabel)
        1    0.495    0.495    1.055    1.055 C:\...\vtapp.py:104(__init__)
    78459    0.414    0.000    0.414    0.000 :0(time)
     5502    0.355    0.000    1.793    0.000 C:\...\vtTables\hpViewport.py:144(paintCell)
     5536    0.333    0.000    0.974    0.000 :0(paintCell)
       23    0.314    0.014    1.972    0.086 C:\...\vtTables\hpViewport.py:253(tableFault)
     5502    0.235    0.000    0.641    0.000 C:\...\vtWidgets\vtTableItem.py:65(paint)
     5502    0.227    0.000    0.301    0.000 :0(paint)
     1902    0.148    0.000    1.940    0.001 :0(eventFilter)


<pstats.Stats instance at 0x093AFE68>
>>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setLabelSingleBenchmark.py
Type: application/x-python
Size: 519 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070622/f5271cd7/setLabelSingleBenchmark.bin


More information about the PyQt mailing list