[Interest] How to avoid qml engine repeatedly copying and garbage collecting qstringlists?

NIkolai Marchenko enmarantispam at gmail.com
Mon Oct 23 11:41:28 CEST 2023


Qt 5.15.2

I've encountered a strange behaviour while trying to pass the output of
QFontDatabase::families() into qml via Q_PROPERTY of a singleton class.
Essentially - I have a ton of qml items accessing this property in their
initialization and every one of them is doing an .includes search on it.

What happened is it has produced an absolutely massive slowdown and after
perfing what's happening there it seems like qml engine is repeatedly
recreating this stringlist inside the engine and garbage collecting it on
every access instead of keeping it around. Is there something that can be
done about it and what is even happening there?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20231023/e5e009ad/attachment.htm>


More information about the Interest mailing list