[Qt-interest] Performance issue with QGraphicsScene::createItemGroup

luper rouch luper.rouch at gmail.com
Wed Jan 27 00:18:18 CET 2010


I'm using the Qt graphics API to display layers in some GIS software.

Each layer is a group, containing graphic primitives. I have a
performance issue when loading fairly large data sets, for example
this is what happens when making a group composed of ~96k circular
paths (points from a shapefile):

http://f.imagehost.org/0751/callgrind-createItemGroup.png

The QGraphicsScene::createItemGroup() call takes about 150 seconds to
complete on my 2.4GHz core2, and it seems all this time is used in
QGraphicsItemPrivate::updateEffectiveOpacity(), which itself consumes
37% of its time calling QGraphicsItem::flags() 4 /billion/ times (the
data comes from a test script with no GUI, just a scene, not even tied
to a view).

All the rest is pretty much instantaneous (like creating the items,
reading the file, etc...). I tried to disable the scene's index before
creating the group with similar results.

What could I do to improve performances in this case ?

-- 
Lup



More information about the Qt-interest-old mailing list