Commit Graph

11 Commits

Author SHA1 Message Date
Frédéric Sagnes 4a3857ef1d Use JSStringCreateWithUTF8CString and skip NSString decoding when loading the bundle
Summary: public

Benchmarking our startup path has shown we spend a lot of time decoding strings (iPhone 4S / iPhone 5):

* reading a 2MB JS bundle: 35ms / 15ms
* decoding is to an `NSString`: 186ms / 78ms
* transforming that to a `JSString`: 29ms / 10ms

Instead of going through an `NSString` transformation, we generate a null-terminated bundle (0.1ms / 0.05ms to copy the data) and use `JSStringCreateWithUTF8CString` (121ms / 53ms) to generate the string. That makes decoding 70% faster.

Reviewed By: javache

Differential Revision: D2541140

fb-gh-sync-id: 09a016b8edfd46a9b62682c76705564d2024e75e
2015-10-16 08:11:25 -07:00
Pieter De Baets fa07736ee1 Remove isValid from RCTInvalidating
Summary:
We only actually use it on RCTBridge and RCTJavaScriptExecutor, so add it to these interfaces explicitly
2015-08-14 01:57:18 -08:00
Tadeu Zagallo d30ada61f0 [ReactNative] Remove unused executor context id
Summary:
Remove `RCTGetExecutorID` and `RCTSetExecutorID`, it wasn't used anymore since
the bridge was refactored into `RCTBridge` and `RCTBatchedBridge`.
2015-07-14 16:40:21 -08:00
James Ide c953aa7e0b [Executor] Make executor ID functions non-static to fix ASan
Summary:
When `RCTGetExecutorID` was a static function in the header file, it would return nil when the app was running with ASan enabled even though directly calling `objc_getAssociatedObject(executor, RCTJavaScriptExecutorID)` returned the correct ID as an NSNumber. Moving this function into the .m file fixes this issue.

Closes https://github.com/facebook/react-native/pull/1712
Github Author: James Ide <ide@jameside.com>

Test Plan:  Run the UIExplorer with ASan enabled in Xcode 7. Before this diff, the app would just hang since the executor was unable to read a valid ID and so it would bail out from running JS. With this diff the executor runs the JS and the UIExplorer works fine.
2015-06-29 04:30:29 -08:00
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -08:00
Tadeu Zagallo 847dff8d75 [ReactNative] Make JavaScript executors bridge modules
Summary:
@public

This is the first of a few diffs that change the way the executors are handled
by the bridge.

For they are just promoted to modules, so they are automatically loaded by the bridge.

Test Plan:
Tested on UIExplorer, Catalyst and MAdMan.
Tested all the 3 executors, everything looks fine.
2015-06-09 15:40:55 -08:00
Tadeu Zagallo 2f4430cf51 [ReactNative] Fix bridge event dedupe 2015-04-28 07:58:35 -08:00
Tadeu Zagallo 3595b79ec3 [ReactNative] Move VSync bound events to JS thread 2015-04-22 07:01:48 -08:00
Tadeu Zagallo d6afe1b124 [ReactNative] Don't break when can't create executor 2015-04-20 11:21:42 -08:00
Tadeu Zagallo 0e67e33534 [ReactNative] Ensure JS calls scheduled by a deallocated context don't fire 2015-04-20 02:03:22 -08:00
Tadeu Zagallo 20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00