qtdeclarative/tools
Alexandru Croitor 2ee7ec4d24 qmlimportscanner: Improve performance using caches continued
Cache module details (plugin path, components, etc) for each
processed module.
Cache recursive dependency module details for each processed
module.
Skip self dependencies.
Discard duplicates when merging module details.

Use a custom hasher object to store QVariantMaps in
std::unordered_set / std::unordered_map because QVariant does not
provide a qHash overload.

With the improvements above, for a project that has 100 qml files,
each importing QtQuick.Controls and QtQuick as many times
as the file index (file 100 imports QtQuick and Controls 100 times),
the execution time is reduced ~7x times.

Before 1.52s user 0.22s system 99% cpu 1.741 total
After  0.22s user 0.03s system 97% cpu 0.248 total

For the examples/quickcontrols2/gallery project, the stats are

Before 0.81s user 0.13s system 96% cpu 0.968 total debug
After  0.17s user 0.03s system 75% cpu 0.266 total debug
Before 0.15s user 0.09s system 95% cpu 0.251 total release
After  0.05s user 0.03s system 54% cpu 0.138 total release

That's a ~5x improvement for a debug build of qmlimportscanner
and a ~3x improvement for a release build of qmlimportscanner.

Benched on a 16" Intel macbook pro 2019 with a USB SSD.

Pick-to: 6.2 6.3
Fixes: QTBUG-103187
Change-Id: I730d762ff99b52918568fdf119eb68201a7d6c4a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-04 17:52:15 +02:00
..
qml qml: Don't mangle the settings URL 2022-03-02 08:59:55 +01:00
qmlcachegen Turn qmlcompiler into a shared library 2022-03-25 13:12:32 +01:00
qmldom Skip unnecessary commands when cross-building tools 2021-10-08 10:37:35 +02:00
qmleasing Remove unused .qrc files 2022-01-20 19:33:01 +01:00
qmlformat qmlformat: Implement settings file 2021-10-26 12:03:40 +02:00
qmlimportscanner qmlimportscanner: Improve performance using caches continued 2022-06-04 17:52:15 +02:00
qmljs Turn qmljs into app 2022-01-20 20:33:01 +02:00
qmljsrootgen qmllint: Properly handle JavaScript functions with variable arguments 2021-11-26 21:23:08 +01:00
qmllint Replace uses of deprecated _qs with _s/QStringLiteral 2022-04-29 09:47:43 +02:00
qmlls GCC std::optional whack-a-mole [2/N]: qmlls 2022-06-02 02:42:51 +02:00
qmlplugindump qml{plugindump|importscanner}: Don't mix std::cerr and std::wcerr 2022-01-06 16:54:14 +01:00
qmlpreview Skip unnecessary commands when cross-building tools 2021-10-08 10:37:35 +02:00
qmlprofiler Replace 0 pointer constants with nullptr 2021-10-18 12:39:28 +02:00
qmlscene Fix qmlscene CMakeLists.txt 2022-01-24 17:39:21 +00:00
qmltc Inherit base type access semantics in QQmlJSScopes 2022-06-02 10:07:40 +02:00
qmltestrunner Skip unnecessary commands when cross-building tools 2021-10-08 10:37:35 +02:00
qmltime Skip unnecessary commands when cross-building tools 2021-10-08 10:37:35 +02:00
shared Replace uses of deprecated _qs with _s/QStringLiteral 2022-04-29 09:47:43 +02:00
CMakeLists.txt Re-add qmlprofiler qmleasing and qmlplugindump to default target 2022-05-11 10:56:22 +00:00