Installing qml caches

Volker Krause vkrause at kde.org
Tue Jul 3 09:21:56 BST 2018


On Friday, 1 June 2018 13:10:57 CEST Alexander Volkov wrote:
> Hi all,
> 
> It would be nice to install .qmlc files in addition to .qml files to
> reduce start-up time of applications.
> They are generated with qmlcachegen. For Qt 5.11:
> qmlcachegen -o example.qmlc qxample.qml
> 
> Currently qml files are usually installed the following way:
> install(DIRECTORY qml/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kcm)
> 
> So this could be changed to something like
> ecm_install_qml(qml org/kde/kcm)
> 
> I wonder whether someone already working on this or want to implement
> such a function?
> If not, I'll try to do it myself.

Qt 5.11 actually has something like this, but only covering QML files compiled 
in via qrc, see qtquick_compiler_add_resources() (I needed a very recent 5.11 
branch build though for this to work, post 5.11.1).

I have no performance measurements yet, but at least the package size goes up 
contrary to what one might expect, as the compiled binary is 2-3x larger than 
the (non-minified) QML source code. That space would be needed by the qmlc 
files anyway in the end though, so overall disk space cost goes down a bit 
once deployed.

With the QML sources no longer included you end up with a non-starting 
application after updating Qt though.

So, interesting for APKs etc where you fully control Qt, but probably not for 
distros.

Regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20180703/58ec3fc7/attachment.sig>


More information about the kde-core-devel mailing list