Make JSCRuntime::createValue 35% faster (#27016)
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

javache/react-native,javache/react-native,hammerandchisel/react-native,hoangpham95/react-native,pandiaraj44/react-native,exponent/react-native,hoangpham95/react-native,arthuralee/react-native,javache/react-native,hoangpham95/react-native,pandiaraj44/react-native,myntra/react-native,myntra/react-native,pandiaraj44/react-native,myntra/react-native,exponent/react-native,exponent/react-native,hammerandchisel/react-native,javache/react-native,hammerandchisel/react-native,hammerandchisel/react-native,myntra/react-native,janicduplessis/react-native,javache/react-native,exponent/react-native,exponentjs/react-native,myntra/react-native,facebook/react-native,pandiaraj44/react-native,janicduplessis/react-native,exponentjs/react-native,myntra/react-native,pandiaraj44/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,pandiaraj44/react-native,myntra/react-native,javache/react-native,myntra/react-native,janicduplessis/react-native,hoangpham95/react-native,exponent/react-native,hammerandchisel/react-native,hammerandchisel/react-native,exponentjs/react-native,facebook/react-native,facebook/react-native,arthuralee/react-native,pandiaraj44/react-native,arthuralee/react-native,hammerandchisel/react-native,myntra/react-native,hoangpham95/react-native,exponent/react-native,facebook/react-native,exponentjs/react-native,exponent/react-native,javache/react-native,hammerandchisel/react-native,janicduplessis/react-native,janicduplessis/react-native,hoangpham95/react-native,javache/react-native,exponentjs/react-native,facebook/react-native,arthuralee/react-native,javache/react-native,exponentjs/react-native,hoangpham95/react-native,exponent/react-native,arthuralee/react-native,pandiaraj44/react-native,exponentjs/react-native,janicduplessis/react-native,exponentjs/react-native,hoangpham95/react-native,facebook/react-native,facebook/react-native