Skip to content

Commit 996630b

Browse files
hoxyqfacebook-github-bot
authored andcommitted
Avoid copying samples list when serializing (#50985)
Summary: Pull Request resolved: #50985 # Changelog: [Internal] There may be tens of thousands of samples stored, so we should avoid copying it. I don't think we should restrict it from being copied, though, but we don't need it to copy in this case. Reviewed By: huntie, dannysu Differential Revision: D73106950 fbshipit-source-id: 45c027ea8bfc3424fe3428f5578d5bed3d1cdda9
1 parent b08f87a commit 996630b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeSamplingProfileSerializer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ RuntimeSamplingProfile::Sample convertHermesSampleToTracingSample(
151151
/* static */ RuntimeSamplingProfile
152152
HermesRuntimeSamplingProfileSerializer::serializeToTracingSamplingProfile(
153153
const hermes::sampling_profiler::Profile& hermesProfile) {
154-
std::vector<hermes::sampling_profiler::ProfileSample> hermesSamples =
154+
const std::vector<hermes::sampling_profiler::ProfileSample>& hermesSamples =
155155
hermesProfile.getSamples();
156156
std::vector<RuntimeSamplingProfile::Sample> reconciledSamples;
157157
reconciledSamples.reserve(hermesSamples.size());

0 commit comments

Comments
 (0)