Files
react-native/ReactCommon
Radek Pietruszewski 24e0bad8be Make JSCRuntime::createValue 35% faster (#27016)
Summary:
JSC does some sort of thread safety locking on every single JSC API call, which makes them ridiculously expensive for a large number of calls (such as when passing a large array over the RN bridge). It would be great if we could lock and unlock once for an entire sequence of JSC calls… but in the meantime, the less we call JSC the better.

![unknown](https://user-images.githubusercontent.com/183747/67624956-08bd6e00-f838-11e9-8f65-e077693f113d.png)

In my benchmark environment (https://github.com/Nozbe/WatermelonDB/pull/541), the time spent in JSCRuntime::createValue went down from 1.07s to 0.69s by changing JSValueIsXXXX calls to a single JSValueGetType call.

The underlying implementation does the same thing: https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/API/JSValueRef.cpp#L58

## Changelog

[General] [Fixed] - Make JSCRuntime::createValue faster
Pull Request resolved: https://github.com/facebook/react-native/pull/27016

Reviewed By: RSNara

Differential Revision: D18769047

Pulled By: mhorowitz

fbshipit-source-id: 9d1ee28840303f7721e065c1b3c347e354cd7fef
2020-02-20 10:33:16 -08:00
..
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00
2020-02-20 08:30:46 -08:00