Avoid potential copies of TraceEvent before serialization (#52196)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52196

# Changelog: [Internal]

Probably been overlooked for quite some time, but shouldn't be a bottleneck.

Reviewed By: motiz88

Differential Revision: D77148271

fbshipit-source-id: e8eb32137086d6c280aab2ec5903be03f96175ad
This commit is contained in:
Ruslan Lesiutin
2025-06-25 05:38:31 -07:00
committed by Facebook GitHub Bot
parent 823414e691
commit 448fe573e0
@@ -94,7 +94,7 @@ void PerformanceTracer::collectEvents(
}
auto traceEvents = folly::dynamic::array();
for (auto event : buffer_) {
for (const auto& event : buffer_) {
// Emit trace events
traceEvents.push_back(serializeTraceEvent(event));