[Development] Item creation time in QML

Gunnar Sletta gunnar at sletta.org
Mon Feb 9 11:25:49 CET 2015


Hi,

Thought I would share a couple of benchmark numbers for item creation time in QML. The sources are found here: https://github.com/sletta/stuff/tree/master/qml/benchmarks <https://github.com/sletta/stuff/tree/master/qml/benchmarks>. The motivation is that we can generally animate a large number of items, but we often stutter when adding and removing stuff from the scene or when scrolling complex lists.

How the benchmark works is that the it tries to figure out how many operations of a given type is possible each frame (not per second) while sustaining a perfect 60 fps (or whatever other fps you target). For these numbers, we’re looking at delegation creation and destruction. You can look at the content of each specific benchmark here: https://github.com/sletta/stuff/tree/master/qml/benchmarks/benchmark/creation <https://github.com/sletta/stuff/tree/master/qml/benchmarks/benchmark/creation>. 

This was measured on my 13” MacBookPro, Intel i5 2.6Ghz, Intel Iris GPU using ‘dev’. On lower end mobile and embedded, the numbers can be an order of magnitude lower. 

> ./qmlbench --delay 2500 --repeat 5 --fullscreen --fps-interval 2000  benchmark/creation
running: "benchmark/creation/delegates_blendedrect.qml"
     485 ops/frame
     490 ops/frame
     487 ops/frame
     477 ops/frame
     489 ops/frame
     485.6 ops/frame average
running: "benchmark/creation/delegates_buttoncontrol.qml"
     10 ops/frame
     10 ops/frame
     10 ops/frame
     10 ops/frame
     10 ops/frame
     10 ops/frame average
running: "benchmark/creation/delegates_complex.qml"
     11 ops/frame
     11 ops/frame
     11 ops/frame
     11 ops/frame
     11 ops/frame
     11 ops/frame average
running: "benchmark/creation/delegates_image.qml"
     303 ops/frame
     304 ops/frame
     301 ops/frame
     304 ops/frame
     304 ops/frame
     303.2 ops/frame average
running: "benchmark/creation/delegates_labelcontrol.qml"
     81 ops/frame
     81 ops/frame
     80 ops/frame
     81 ops/frame
     82 ops/frame
     81 ops/frame average
running: "benchmark/creation/delegates_longtext.qml"
     37 ops/frame
     37 ops/frame
     37 ops/frame
     37 ops/frame
     37 ops/frame
     37 ops/frame average
running: "benchmark/creation/delegates_rect.qml"
     527 ops/frame
     530 ops/frame
     527 ops/frame
     526 ops/frame
     531 ops/frame
     528.2 ops/frame average
running: "benchmark/creation/delegates_script.qml"
     382 ops/frame
     387 ops/frame
     387 ops/frame
     374 ops/frame
     385 ops/frame
     383 ops/frame average
running: "benchmark/creation/delegates_text.qml"
     128 ops/frame
     128 ops/frame
     127 ops/frame
     128 ops/frame
     127 ops/frame
     127.6 ops/frame average
running: "benchmark/creation/delegates_text_nativerendering.qml"
     138 ops/frame
     137 ops/frame
     136 ops/frame
     137 ops/frame
     136 ops/frame
     136.8 ops/frame average
running: "benchmark/creation/delegates_text_plain.qml"
     130 ops/frame
     129 ops/frame
     128 ops/frame
     128 ops/frame
     129 ops/frame
     128.8 ops/frame average
running: "benchmark/creation/delegates_text_richtext.qml"
     46 ops/frame
     46 ops/frame
     46 ops/frame
     46 ops/frame
     46 ops/frame
     46 ops/frame average
running: "benchmark/creation/delegates_text_styled.qml"
     125 ops/frame
     125 ops/frame
     126 ops/frame
     126 ops/frame
     125 ops/frame
     125.4 ops/frame average
running: "benchmark/creation/delegates_tworects.qml"
     314 ops/frame
     312 ops/frame
     313 ops/frame
     314 ops/frame
     315 ops/frame
     313.6 ops/frame average
All done...

—

Being able to do 500+items rectangles in one frame is decent, but not awesome. Being able todo 130 text items in one frame, is less than ideal, given that we often use several text items per cell in a list or table. Text is probably the most important UI element we have. Being able to do 10 buttons is, well, unfortunate :) If we look at Button, we see that it is a fairly complex QML beast. Hierarchy is 

Button -> BasicButton -> Control -> FocusScope

and there are quite a bit of stuff on every level, including the dynamic style handling which will in turn create a StyleItem. 

And keep in mind that even though this isn’t the most high-end mac, it is sitll a pretty decent computer, Qt is supposed to run on much worse hardware than this.

—

There have been a few changes going into 5.5 which make these numbers better than 5.4, but I still think we got quite a ways to go. 

cheers,
Gunnar




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150209/f7f24da5/attachment.html>


More information about the Development mailing list