From 521011d4cc713dfce97dc8872fd0f5171e587b5d Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 4 Aug 2022 16:19:17 -0700 Subject: [PATCH] Avoid full copy of large folly::dynamic objects in JSIExecutor#defaultTimeoutInvoker [RFC] Summary: Current creation of the errorProcessor lambda does a full copy of folly::dynamic object, which for large objects can cause 1000's of memory allocations, and thus increasing app's memory footprint and speed. Changelog: [General][Fixed] - Avoid full copy of large folly::dynamic objects in JSIExecutor#defaultTimeoutInvoker Reviewed By: sammy-SC Differential Revision: D38368392 fbshipit-source-id: 88579a7069891828cf6dae130c4964db6b494565 --- ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index 7c957221400cb8..d9fa242de9c724 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -242,8 +242,7 @@ void JSIExecutor::callFunction( // by value. auto errorProducer = [=] { std::stringstream ss; - ss << "moduleID: " << moduleId << " methodID: " << methodId - << " arguments: " << folly::toJson(arguments); + ss << "moduleID: " << moduleId << " methodID: " << methodId; return ss.str(); };