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
This commit is contained in:
Christoph Purrer
2022-08-11 16:09:27 +01:00
committed by Lorenzo Sciandra
parent a0ae1fb525
commit 9424d2c85c
@@ -244,8 +244,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();
};