[Qt4-preview-feedback] qtreewidget performance hack

Marcel Partap mpartap at gmx.net
Mon Feb 2 13:02:34 CET 2009


Hi,
kdiff3 is a tool i regularly use to compare folder hierarchies, but 
what always troubled me a bit was the performance issues when 
traversing the tree or showing/hiding a subset of items (equal, 
orphans in A/B).. when i did a valgrind --tool=callgrind run on it 
yesterday i finally saw where all this time is spent - within the 
QTreeWidget::isItemHidden function! That is maintaining a list of 
hidden items and traverses that each and every time to find out wheter 
an individual item actually is hidden. Comparing two folder 
hierarchies with a total of ~8000 items thus results in over 150 
million iterations within that loop! The simple hack which is attached 
obviously cut that down massively, but i'm not sure wether it might 
break any functionality that is provided by iterating over that list.. 
Does it?
rgds marcel.


-- 
   "Obstacles are those frightful things you see when you take
    your eyes off your goal."         -- Henry Ford (1863-1947)

    Change the world! Vote: http://hfopi.org/vote-future
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qtreewidget-speed-hack.patch
Url: http://lists.qt.nokia.com/pipermail/qt4-feedback/attachments/20090202/23460e7f/attachment.pl 


More information about the Qt4-feedback mailing list