[Development] How to speed up QML for KDE5 without QML compiler

Guenter Schwann guenterlists at schwann.at
Wed Sep 16 12:12:21 CEST 2015

On Wednesday 16 September 2015 12:03:38 Leslie Zhai wrote:
> Hi great Qt and KDE developers,
> I like QML, it is high speed development language, easy to create candy
> UI and not difficult to debug. KDE4 began to use it in some projects,
> for example, KScreen`s kcm module, it used QML to take place of
> traditional QWidget. and KDE5, it is full of QML, for example, kwin`s
> tabbox, plasma-desktop and plasma-workspace`s applet, sddm, etc.
> For a new PC,  there is no sharp difference between QML and QWidget, but
> in a very very old PC, how old? about 7 years ago, QML is very slow! and
> it needs to close all effects for KDE5, even that when clicked, for
> example, calendar applet, it hang about 3+ seconds to showPopup.
> There is commercial QML compiler, a very small example tried to use it
> https://github.com/AOSC-Dev/AOSC-VersionHelper2
> But is it suitable for huge projects just like KDE5 if bought a
> commercial license? because not all KF5 components follow the Qt Quick
> Compiler`s resource.qrc way, so is it able to compile? for example,
> kickoff applet (the start menu of KDE5).


One generic advise is to use the Loader item a lot. So only visible/needed 
items are created.
This helps a lot for the startup performance.

And in the Loader rather use the source instead of the sourceComponent 
property (or use the setSource() function). As the sourceComponent still 
parses all stuff (although the binding is the biggest time consumer usually).

It will make your code more complex. And of course has it's limits and might 
not be your biggest bottleneck. But usually helps a lot.

Guenter Schwann

More information about the Development mailing list