mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[ReactNative] Optimize console.profile and add markers on JS entry points
Summary:
@public
Right now the profiler shows how long the executor took on JS but doesn't show
how long each of the batched calls took, this adds a *very* high level view of JS
execution (still doesn't show properly calls dispatched with setImmediate)
Also added a global property on JS to avoid trips to Native when profiling is
disabled.
Test Plan:
Run the Profiler on any app
{F22491690}
This commit is contained in:
@@ -921,6 +921,7 @@ RCT_EXPORT_METHOD(findSubviewIn:(NSNumber *)reactTag atPoint:(CGPoint)point call
|
||||
|
||||
- (void)batchDidComplete
|
||||
{
|
||||
RCTProfileBeginEvent();
|
||||
// Gather blocks to be executed now that all view hierarchy manipulations have
|
||||
// been completed (note that these may still take place before layout has finished)
|
||||
for (RCTViewManager *manager in _viewManagers.allValues) {
|
||||
@@ -951,6 +952,9 @@ RCT_EXPORT_METHOD(findSubviewIn:(NSNumber *)reactTag atPoint:(CGPoint)point call
|
||||
_nextLayoutAnimation = nil;
|
||||
}
|
||||
|
||||
RCTProfileEndEvent(@"[RCTUIManager batchDidComplete]", @"uimanager", @{
|
||||
@"view_count": @([_viewRegistry count]),
|
||||
});
|
||||
[self flushUIBlocks];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user