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.
This commit is contained in:
parent
b8d002af1a
commit
275f2a85b2
|
@ -335,7 +335,7 @@ cmState::TargetType cmGeneratorTarget::GetType() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmGeneratorTarget::GetName() const
|
const std::string& cmGeneratorTarget::GetName() const
|
||||||
{
|
{
|
||||||
return this->Target->GetName();
|
return this->Target->GetName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
GetLinkInformation(const std::string& config) const;
|
GetLinkInformation(const std::string& config) const;
|
||||||
|
|
||||||
cmState::TargetType GetType() const;
|
cmState::TargetType GetType() const;
|
||||||
std::string GetName() const;
|
const std::string& GetName() const;
|
||||||
std::string GetExportName() const;
|
std::string GetExportName() const;
|
||||||
|
|
||||||
std::vector<std::string> GetPropertyKeys() const;
|
std::vector<std::string> GetPropertyKeys() const;
|
||||||
|
|
Loading…
Reference in New Issue