From 085868d098a9e675d1555f5c0ea4ed8bc0842fb8 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Fri, 20 Dec 2024 13:52:19 +0000 Subject: [PATCH] HPCC-31003 Move instead of copying objects to improve performance Signed-off-by: Shamser Ahmed --- common/workunit/workunit.cpp | 2 +- system/jlib/jstats.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/workunit/workunit.cpp b/common/workunit/workunit.cpp index 8e42207db59..112caeb9a7e 100644 --- a/common/workunit/workunit.cpp +++ b/common/workunit/workunit.cpp @@ -2708,7 +2708,7 @@ void StatisticsAggregator::recordStats(IStatisticCollection * sourceStats, unsig verifyex(graphScopeId.setScopeText(graphName)); StatsScopeId wfScopeId(SSTworkflow, wfid); StatsScopeId sgScopeId(SSTsubgraph, sgId); - statsCollection->recordStats(mapping, sourceStats, {wfScopeId, graphScopeId, sgScopeId}); + statsCollection->recordStats(mapping, sourceStats, {std::move(wfScopeId), std::move(graphScopeId), std::move(sgScopeId)}); } // Recalculate aggregates and then write the aggregates to global stats (dali) diff --git a/system/jlib/jstats.cpp b/system/jlib/jstats.cpp index bba06151c6f..9daa4b671cc 100644 --- a/system/jlib/jstats.cpp +++ b/system/jlib/jstats.cpp @@ -2242,7 +2242,7 @@ class CStatisticCollection : public CInterfaceOf ++scopeItem; } - CStatisticCollection * tgtScopeCollection = ensureSubScopePath(path); + CStatisticCollection * tgtScopeCollection = ensureSubScopePath(std::move(path)); bool wasUpdated = false; // More efficient to iterate over stats rather than mapping... ForEachItemIn(i, curSrcCollection->stats)