summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorFrank Winklmeier <frank.winklmeier@cern.ch>2018-02-13 17:18:50 (GMT)
committerFrank Winklmeier <frank.winklmeier@cern.ch>2018-02-23 16:06:28 (GMT)
commit2d1e5adaeb5827ebdd3111388f2fcda98656b8ac (patch)
treed2f8401f418f57b14dcaff562e2cf2273abec725 /Source/cmMakefile.h
parenta08ede979bd0c57906c8ebf4120192f8202ce0d8 (diff)
downloadCMake-2d1e5adaeb5827ebdd3111388f2fcda98656b8ac.zip
CMake-2d1e5adaeb5827ebdd3111388f2fcda98656b8ac.tar.gz
CMake-2d1e5adaeb5827ebdd3111388f2fcda98656b8ac.tar.bz2
cmMakefile: Improve performance of GetSource for known files
Store "Known" files separately in KnownFileSearchIndex. This avoids creating the rather expensive cmSourceFileLocation object for source files that are already known. For large projects this results in a factor 3-4 speedup of cmGlobalGenerator::Compute().
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 5a30790..95ba53a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -861,6 +861,9 @@ protected:
typedef std::unordered_map<std::string, SourceFileVec> SourceFileMap;
SourceFileMap SourceFileSearchIndex;
+ // For "Known" paths we can store a direct filename to cmSourceFile map
+ std::unordered_map<std::string, cmSourceFile*> KnownFileSearchIndex;
+
// Tests
std::map<std::string, cmTest*> Tests;