[ReactNative] Send batched calls from objc to js every frame + add bridge profiling

This commit is contained in:
Tadeu Zagallo
2015-04-17 04:02:37 -07:00
parent 70a28547dd
commit 1883ba535c
10 changed files with 277 additions and 163 deletions

View File

@@ -15,6 +15,15 @@
#import "RCTSparseArray.h"
#import "RCTUtils.h"
@interface RCTBridge (Private)
/**
* Allow super fast, one time, timers to skip the queue and be directly executed
*/
- (void)_immediatelyCallTimer:(NSNumber *)timer;
@end
@interface RCTTimer : NSObject
@property (nonatomic, strong, readonly) NSDate *target;
@@ -160,7 +169,7 @@ RCT_EXPORT_METHOD(createTimer:(NSNumber *)callbackID
{
if (jsDuration == 0 && repeats == NO) {
// For super fast, one-off timers, just enqueue them immediately rather than waiting a frame.
[_bridge enqueueJSCall:@"RCTJSTimers.callTimers" args:@[@[callbackID]]];
[_bridge _immediatelyCallTimer:callbackID];
return;
}