diff options
author | Thomas Sondergaard <[email protected]> | 2016-11-01 09:35:31 +0100 |
---|---|---|
committer | Thomas Sondergaard <[email protected]> | 2016-11-03 17:34:57 +0000 |
commit | 4df5003ee7b47a55b2a06b69d57c1a2ca4314607 (patch) | |
tree | d90cd59b16a352424987f5518b0dc92b8c347124 /src/tools/moc/preprocessor.h | |
parent | 36d3f24d6aebf9d4f56d42eb7702fc40c7406e29 (diff) |
moc: Cache header lookups to reduce number of file stat's
This improves moc performance on Windows where file-stat'ing is slow
and where the number of project include paths to search is often high
because project third-party headers are installed in separate
directories rather than a shared include path such as /usr/include.
In a real project of non-trivial size it reduces the total
from-scratch build time of an optimized build using CMake+ninja with
32 cores by 11% from ~11m35s to ~10m15s.
Change-Id: Ieed59646927ed75c55ed9efa97600c328b2fed2c
Reviewed-by: Olivier Goffart (Woboq GmbH) <[email protected]>
Diffstat (limited to 'src/tools/moc/preprocessor.h')
-rw-r--r-- | src/tools/moc/preprocessor.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h index a7eb1a19e19..39f56d6e923 100644 --- a/src/tools/moc/preprocessor.h +++ b/src/tools/moc/preprocessor.h @@ -61,6 +61,7 @@ public: static bool preprocessOnly; QList<QByteArray> frameworks; QSet<QByteArray> preprocessedIncludes; + QHash<QByteArray, QByteArray> nonlocalIncludePathResolutionCache; Macros macros; QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo); Symbols preprocessed(const QByteArray &filename, QFile *device); |