SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Make JSStringToSTLString 23x faster (#26955)

Summary:
In my app I have a case where I need to pass a very large string (45MB) between JS and native. This is obviously suboptimal, but… this is where I'm at.

The main bottleneck to doing this turned out to be `jsi`'s `JSStringToSTLString()`, which was extremely slow. In my case, 4.7s to execute. After this change, 204ms.

I don't really know C++, so I'm not sure this code is 100% correct and safe, and I bet it could be done even better by avoiding the extra memory allocation (would shave off another 70ms).

## Changelog

[General] [Changed] - Make JSStringToSTLString 23x faster
Pull Request resolved: https://github.com/facebook/react-native/pull/26955

Reviewed By: shergin

Differential Revision: D19578728

Pulled By: motiz88

fbshipit-source-id: 2fbce83166953ce928f0a6aa36eed710bfe05383
R
Radek Pietruszewski committed
733532e5e95c85b8295b6c66009ca9efd2a77622
Parent: 142c66f
Committed by Facebook Github Bot <[email protected]> on 1/28/2020, 6:26:25 PM