[Qt-qml] QDeclarativeItem subclasses and mouse events

Jan Ekholm jan.ekholm at smultron.net
Thu Aug 5 09:09:11 CEST 2010


On Thursday 05 August 2010 09:03:36 michael.brasser at nokia.com wrote:

> In tests/benchmarks/declarative there is a tool called qmltime that can be
> used to profile component creation costs. Running my N900:
> 
> * the original QML tile took 2.13ms to create
> * the same tile with the 5 bindings removed (just assigning the values
> directly) took .35ms

My default test map had 1500 hexes, which immediately brings just the item 
creation to over 3s, not including (I guess) the actual image loading or any 
other components.
 
> For this component, *none* of the bindings hit the binding optimizer, which
> is why removing them had such a large impact. We'll continue to expand the
> scope of the optimizer (so it hits more cases), as well as further
> optimize those that don't hit the optimizer in future releases, so
> hopefully these cases become fewer and fewer.

That would perhaps means that binding to C++ properties is not covered by the 
optimizer? All the data for that item comes from C++, which also is the case 
for many other QML items in my crappy app.

> The above wouldn't account for the 3-10s load time you are seeing on the PC
> though, so maybe there are some additional factors in play for this
> particular case (but nothing jumped out at me).

There are some other components too. Also, as the old Image loaded the icon 
asynchronously that likely also takes some time that perhaps does not show up 
in the above tool?

> For X11, also remember to use the raster or GL graphics systems for optimal
> QML performance.

I've made raster default in my Qt:s since the -graphicssystem option became 
available. It was the best way to get reasonable visual performance from Qt4.

I won't worry about that it takes some extra seconds setting up the actual 
game. N900 owners are already very used to hideously slow loading for any 
application, so they are not likely to even notice a 10s delay. I could try to 
play some funky music while it loads...

-- 
    Pets are always a great help in times of stress. And in times of 
    starvation too, o'course.
                                        -- Terry Pratchett, Small Gods



More information about the Qt-qml mailing list