Skip to content

Commit

Permalink
HPCC-31003 Move instead of copying object to improve performance
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <[email protected]>
  • Loading branch information
shamser committed Dec 20, 2024
1 parent 70ccefc commit fca7756
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/workunit/workunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions system/jlib/jstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ inline constexpr stat_type statPercent(stat_type value) { return (stat_type)(va
inline constexpr stat_type statPercentageOf(stat_type value, stat_type per) { return value * per / 10000; }

inline StatisticKind queryStatsVariant(StatisticKind kind) { return (StatisticKind)(kind & ~StKindMask); }
inline cost_type money2cost_type(double money) { return money * 1E6; }
inline double cost_type2money(cost_type cost) { return ((double) cost) / 1E6; }
constexpr cost_type money2cost_type(const double money) { return money * 1E6; }
constexpr double cost_type2money(cost_type cost) { return ((double) cost) / 1E6; }

extern jlib_decl void formatTime(StringBuffer & out, unsigned __int64 value);
//---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit fca7756

Please sign in to comment.