[Development] QML instantiation performance

Juha Vuolle juvuolle at gmail.com
Wed Nov 26 09:08:33 CET 2014


Hello,

apologies for cross-posting. I find this such a fundamental issue that I feel
at least having the best possible understanding of it worth it (if any
exists, which is also
a valuable information in itself). I am happy to help if there is
anything I could check.

thanks,
Juha

---

Hello,

I’m having trouble going from Qt 5.1 to 5.3 / 5.4 because of a
slowdown in QML (15..35% slower).
This primarily relates to component instantiation and seems quite
consistent across the platforms and
QPAs I’ve used recently.

If you have any insights, thoughts or something I could check I would
highly appreciate them.

I’ve tested on dual & quadcore imx6 (both EGLFS and XCB) embedded
platform as well as
few desktop Fedoras. I’ve tested with 5.1.1, 5.3.1 and the latest
5.4.0. The slowdown varies
but is fairly consistently between 15..35 %. Instantiation CPU loads
do not seem to be particularly high (< 70%).

Running QML profiler seems to make results less predictable. So I made
a very simple application startup timer
that checks main() -> QQuickWindow::beforeSynchronizing() ->
beforeRendering() -> afterRendering() -> frameSwapped().
Please find my "highly scientific" measurements below. I slowed down
the CPU to make things more clear on the desktop I’m writing
this email from. This behaviour is not specific to only application
startup but later runtime instantiations seem also slower.

I am grateful for any thoughts or things I could check.

Thanks,
Juha

Qt 5.1.1 low CPU qtquickcontrols gallery example startup:
1. onBeforeSynchronizing() for the FIRST time, time it took from main(): 950
2. onBeforeRendering() time it took from beforeSynchronizing: 3
3. onAfterRendering() time it took from beforeRendering: 1572
4. onFrameSwapped() time it took from afterRendering: 5
= 2530 ms for first frame swapped.

Qt 5.3.1 low CPU qtquickcontrols gallery example startup:
1. onBeforeSynchronizing() for the FIRST time, time it took from main(): 1843
2. onBeforeRendering() time it took from beforeSynchronizing: 364
3. onAfterRendering() time it took from beforeRendering: 1039
4. onFrameSwapped() time it took from afterRendering: 83
= 3329 ms for first frame swapped.

Qt 5.1.1 low CPU my application startup:
1. onBeforeSynchronizing() for the FIRST time, time it took from main(): 809
2. onBeforeRendering() time it took from beforeSynchronizing: 3
3. onAfterRendering() time it took from beforeRendering: 1373
4. onFrameSwapped() time it took from afterRendering: 88
= 2273 ms for the first frame swapped

Qt 5.3.1 low CPU my application startup:
1. onBeforeSynchronizing() for the FIRST time, time it took from main(): 1341
2. onBeforeRendering() time it took from beforeSynchronizing: 4
3. onAfterRendering() time it took from beforeRendering: 2184
4. onFrameSwapped() time it took from afterRendering: 10
= 3539 ms for the first frame swapped



More information about the Development mailing list