SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Avoid copying strings when serializing TraceEvent / lock only on buffer operations (#52220)

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

# Changelog: [Internal]

Mainly, 2 changes:
1. `PerformanceTracer::serializeTraceEvent(const TraceEvent& event)` -> `PerformanceTracer::serializeTraceEvent(TraceEvent&& event)` for less copies, actually move strings from the `TraceEvent` into the serialized `folly:object`.
2. When collecting events from the buffer, only lock when accessing buffer, not when serializing.

Reviewed By: rubennorte

Differential Revision: D77164969

fbshipit-source-id: c7dd84dd3c94dae22b89ffd4b229974e6d8084de
R
Ruslan Lesiutin committed
ca647c13c22f60ef302ffdbf460d298f1367f3c5
Parent: 448fe57
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 6/25/2025, 12:38:31 PM