diff options
author | Brad King <brad.king@kitware.com> | 2016-02-08 17:37:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-02-08 18:08:11 (GMT) |
commit | 6cbf6a51976c9092f84ef4a90d35fb6fd60f5898 (patch) | |
tree | 3dfad2feee26d2e3d7100655029dbc4d2d27ab26 /Source/cmMakefile.cxx | |
parent | a5a5a6857241c21d306661d723b749839f4c6e1a (diff) | |
download | CMake-6cbf6a51976c9092f84ef4a90d35fb6fd60f5898.zip CMake-6cbf6a51976c9092f84ef4a90d35fb6fd60f5898.tar.gz CMake-6cbf6a51976c9092f84ef4a90d35fb6fd60f5898.tar.bz2 |
Fix internal target lookup performance regression
Refactoring in commit v3.5.0-rc1~272^2~13 (cmGlobalGenerator: Remove
direct storage of targets, 2015-10-25) replaced an efficient data
structure mapping from target name to cmTarget instance with a linear
search. Lookups through cmGlobalGenerator::FindTarget are done a lot.
Restore the efficient mapping structure with a name indicating its
purpose.
Reported-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index cba29eb..950b247 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2128,6 +2128,7 @@ cmMakefile::AddNewTarget(cmState::TargetType type, const std::string& name) cmTarget& target = it->second; target.SetType(type, name); target.SetMakefile(this); + this->GetGlobalGenerator()->IndexTarget(&it->second); return &it->second; } @@ -4218,6 +4219,7 @@ cmMakefile::AddImportedTarget(const std::string& name, // Add to the set of available imported targets. this->ImportedTargets[name] = target.get(); + this->GetGlobalGenerator()->IndexTarget(target.get()); // Transfer ownership to this cmMakefile object. this->ImportedTargetsOwned.push_back(target.get()); |