diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-18 17:38:48 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-21 21:44:24 +0000 |
commit | 579687e9b2e0a5b6e46f66076615e8b4cd74a8b9 (patch) | |
tree | 5b1a894da1b81e6911040c721b872853eafcebca /src/gui/text | |
parent | 91355527a6ebc7087a769928bf84b20c50055422 (diff) |
Prevent repeated instantiations of some qRegisterNormalizedMetaType<>s [1/N] (QtGui)
Create macros that wrap the magic developed in
7d63efc16f65f98c657caa90e0d7e9b72a879ade and apply it to all
Q_DECLARE_METATYPE invocations that show up in Clang -ftime-trace for
a PCH'ed QtGui build.
Effects on compile times:
Clang 10 -ftme-trace:
$ ClangBuildAnalyzer --analyze qtgui-before.trace | head -n6
Analyzing build trace from 'qtgui-before.trace'...
**** Time summary:
Compilation (523 times):
Parsing (frontend): 628.3 s
Codegen & opts (backend): 304.5 s
$ ClangBuildAnalyzer --analyze qtgui-after.trace | head -n6
Analyzing build trace from 'qtgui-after.trace'...
**** Time summary:
Compilation (523 times):
Parsing (frontend): 546.0 s
Codegen & opts (backend): 304.4 s
GCC 11 time (bash builtin):
before:
$ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done
real 4m13,539s
user 49m24,416s
sys 3m18,177s
after:
$ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done
real 3m55,697s
user 45m19,941s
sys 3m7,370s
Task-number: QTBUG-97601
Change-Id: Ia8e37a58937568a7ed21cfeb4b27274deca4d53b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f29566c5a41c127eacaf13f3dbfe4624e55bc83f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextoption.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextoption.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp index 102bce696b..566e65e896 100644 --- a/src/gui/text/qtextoption.cpp +++ b/src/gui/text/qtextoption.cpp @@ -43,6 +43,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN_TAGGED(QTextOption::Tab, QTextOption_Tab) + struct QTextOptionPrivate { QList<QTextOption::Tab> tabStops; diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h index 629c1d48da..2955fe8dcc 100644 --- a/src/gui/text/qtextoption.h +++ b/src/gui/text/qtextoption.h @@ -151,6 +151,6 @@ inline void QTextOption::setTabStopDistance(qreal atabStop) QT_END_NAMESPACE -Q_DECLARE_METATYPE( QTextOption::Tab ) +QT_DECL_METATYPE_EXTERN_TAGGED(QTextOption::Tab, QTextOption_Tab, Q_GUI_EXPORT) #endif // QTEXTOPTION_H |