Skip to content

Commit

Permalink
Start measuring RCTPLBridgeStartup and RCTPLTTI early
Browse files Browse the repository at this point in the history
Reviewed By: javache

Differential Revision: D3828404

fbshipit-source-id: 7cbfa2eeb60e249be8aad09da5314be998213f0e
  • Loading branch information
alexeylang authored and Facebook Github Bot 8 committed Sep 8, 2016
1 parent c3b4136 commit 532751f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions React/Base/RCTBatchedBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,10 @@ - (instancetype)initWithParentBridge:(RCTBridge *)bridge
moduleProvider:bridge.moduleProvider
launchOptions:bridge.launchOptions]) {
_parentBridge = bridge;
_performanceLogger = [bridge performanceLogger];

RCTLogInfo(@"Initializing %@ (parent: %@, executor: %@)", self, bridge, [self executorClass]);

_performanceLogger = [RCTPerformanceLogger new];
[_performanceLogger markStartForTag:RCTPLBridgeStartup];
[_performanceLogger markStartForTag:RCTPLTTI];

/**
* Set Initial State
*/
Expand Down
9 changes: 4 additions & 5 deletions React/Base/RCTBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ - (void)bindKeys
#endif
}

- (RCTPerformanceLogger *)performanceLogger
{
return self.batchedBridge.performanceLogger;
}

- (NSArray<Class> *)moduleClasses
{
return self.batchedBridge.moduleClasses;
Expand Down Expand Up @@ -239,6 +234,10 @@ - (void)setUp
{
RCT_PROFILE_BEGIN_EVENT(0, @"-[RCTBridge setUp]", nil);

_performanceLogger = [RCTPerformanceLogger new];
[_performanceLogger markStartForTag:RCTPLBridgeStartup];
[_performanceLogger markStartForTag:RCTPLTTI];

// Only update bundleURL from delegate if delegate bundleURL has changed
NSURL *previousDelegateURL = _delegateBundleURL;
_delegateBundleURL = [self.delegate sourceURLForBridge:self];
Expand Down

0 comments on commit 532751f

Please sign in to comment.