[Interest] Why the QML is very very slow with animations?

Denis Shienkov denis.shienkov at gmail.com
Wed Mar 4 17:25:08 CET 2015


Hi all.

I need to create a some Meter which has three circle progresses. This meter
has to have difficult animation and multiple gradients. I know that need to
use the ready background images instead, but in my case it is impossible
(to hard).

So, I use the Qt 5.4.0 where is directly drawing on a Canvas (context2d). I
start a sequential animation by clicking of a mouse on a scene. Where
animated a certain current value from a minimum to a maximum and back (the
sequential number animations).

But I faced with the very slow drawing of progress bars. I see that it
animates with an jerks.

>From the QML profiler I see that the onPaint() event calls every 60-70 msec
(that is 13-14 FPS). But If try to reduce a number of drawing progresses
(e.g. to one instead of three) then the onPaint() calls every 30 msec (that
is ~30-40 FPS).

But it is strange that a time of each onPaint() is ~3.5 - 4 msec. So, in
case even this time will be 5 msec, then a theoretical FPS should be 200
FPS (throughput) !

But if try to expand the window on full screen, then FPS falls to 5 FPS!!!
o_O

This bad performance even for the one Meter with the one animation.. But
what will be happens if I try to add a more animations and additional
Meters?? Then FPS can be decrease to 0!!!

My env:

* Windows8x32
* Qt 5.4.0 MinGW
* Video: Radeon HD 3000
* CPU: AMD x3 455

I don't understand why the number of calls of onPaint() so strongly falls?
Where I'm wrong?

PS: Please see the test project in attachment.

BR,
Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150304/3cab3883/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: meter.zip
Type: application/zip
Size: 5713 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150304/3cab3883/attachment.zip>


More information about the Interest mailing list