Skip to content

Commit

Permalink
Avoid full copy of large folly::dynamic objects in JSIExecutor#defaul…
Browse files Browse the repository at this point in the history
…tTimeoutInvoker [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
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Aug 4, 2022
1 parent d19cee3 commit 521011d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

Expand Down

0 comments on commit 521011d

Please sign in to comment.