remove "prepareReact" call from the iOS bridge

Reviewed By: alexeylang

Differential Revision: D6581907

fbshipit-source-id: ca4bd4beef6d75305133a2b2c7de62e65e5aa3da
This commit is contained in:
Alex Dvornikov 2017-12-26 14:34:05 -08:00 committed by Facebook Github Bot
parent 33a2e533b7
commit 56a42e57d0
1 changed files with 8 additions and 3 deletions

View File

@ -739,6 +739,8 @@ struct RCTInstanceCallback : public InstanceCallback {
{
// This will get called from whatever thread was actually executing JS.
dispatch_block_t completion = ^{
// Log start up metrics early before processing any other js calls
[self logStartupFinish];
// Flush pending calls immediately so we preserve ordering
[self _flushPendingCalls];
@ -1013,16 +1015,19 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
}
}
- (void)_flushPendingCalls
- (void)logStartupFinish
{
// Log metrics about native requires during the bridge startup.
uint64_t nativeRequiresCount = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];
uint64_t nativeRequiresCount = [_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];
[_performanceLogger setValue:nativeRequiresCount forTag:RCTPLRAMStartupNativeRequiresCount];
uint64_t nativeRequires = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequires];
uint64_t nativeRequires = [_performanceLogger valueForTag:RCTPLRAMNativeRequires];
[_performanceLogger setValue:nativeRequires forTag:RCTPLRAMStartupNativeRequires];
[_performanceLogger markStopForTag:RCTPLBridgeStartup];
}
- (void)_flushPendingCalls
{
RCT_PROFILE_BEGIN_EVENT(0, @"Processing pendingCalls", @{ @"count": [@(_pendingCalls.count) stringValue] });
// Phase B: _flushPendingCalls happens. Each block in _pendingCalls is
// executed, adding work to the queue, and _pendingCount is decremented.