diff options
author | Milian Wolff <mail@milianw.de> | 2016-01-15 13:06:45 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-01-20 20:20:54 (GMT) |
commit | 275f2a85b21d781e237dd22252261a0a62d9879b (patch) | |
tree | 09a6f51209fa99e9be43a985e65bca1cd8a0edcf /Source/cmGeneratorTarget.h | |
parent | b8d002af1aeefb435a9560b056f081e5d8dff734 (diff) | |
download | CMake-275f2a85b21d781e237dd22252261a0a62d9879b.zip CMake-275f2a85b21d781e237dd22252261a0a62d9879b.tar.gz CMake-275f2a85b21d781e237dd22252261a0a62d9879b.tar.bz2 |
Remove temporary allocations when calling cmGeneratorTarget::GetName.
This happens quite often from within comparisons such as in
NamedGeneratorTargetFinder or FindGeneratorTargetImpl. It is the
top hotspot of both, number of allocations as well as number of
temporary allocations - the majority of calls lead to temporary
allocations.
In raw numbers, this patch removes ~1E6 temporary allocations of
1.5E6 temporary allocations in total when running the cmake daemon
on the KDevelop build dir. That is 2/3 of the total.
This hotspot was found with heaptrack.
Diffstat (limited to 'Source/cmGeneratorTarget.h')
-rw-r--r-- | Source/cmGeneratorTarget.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index bd23477..d96a32c 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -55,7 +55,7 @@ public: GetLinkInformation(const std::string& config) const; cmState::TargetType GetType() const; - std::string GetName() const; + const std::string& GetName() const; std::string GetExportName() const; std::vector<std::string> GetPropertyKeys() const; |