@@ -739,6 +739,8 @@ - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
739
739
{
740
740
// This will get called from whatever thread was actually executing JS.
741
741
dispatch_block_t completion = ^{
742
+ // Log start up metrics early before processing any other js calls
743
+ [self logStartupFinish ];
742
744
// Flush pending calls immediately so we preserve ordering
743
745
[self _flushPendingCalls ];
744
746
@@ -1013,16 +1015,19 @@ - (void)_runAfterLoad:(RCTPendingCall)block
1013
1015
}
1014
1016
}
1015
1017
1016
- - (void )_flushPendingCalls
1018
+ - (void )logStartupFinish
1017
1019
{
1018
1020
// Log metrics about native requires during the bridge startup.
1019
- uint64_t nativeRequiresCount = [self -> _performanceLogger valueForTag: RCTPLRAMNativeRequiresCount];
1021
+ uint64_t nativeRequiresCount = [_performanceLogger valueForTag: RCTPLRAMNativeRequiresCount];
1020
1022
[_performanceLogger setValue: nativeRequiresCount forTag: RCTPLRAMStartupNativeRequiresCount];
1021
- uint64_t nativeRequires = [self -> _performanceLogger valueForTag: RCTPLRAMNativeRequires];
1023
+ uint64_t nativeRequires = [_performanceLogger valueForTag: RCTPLRAMNativeRequires];
1022
1024
[_performanceLogger setValue: nativeRequires forTag: RCTPLRAMStartupNativeRequires];
1023
1025
1024
1026
[_performanceLogger markStopForTag: RCTPLBridgeStartup];
1027
+ }
1025
1028
1029
+ - (void )_flushPendingCalls
1030
+ {
1026
1031
RCT_PROFILE_BEGIN_EVENT (0 , @" Processing pendingCalls" , @{ @" count" : [@(_pendingCalls.count) stringValue ] });
1027
1032
// Phase B: _flushPendingCalls happens. Each block in _pendingCalls is
1028
1033
// executed, adding work to the queue, and _pendingCount is decremented.
0 commit comments