@@ -40,6 +40,7 @@ var ReactFiberCompleteWork = require('ReactFiberCompleteWork');
40
40
var ReactFiberCommitWork = require ( 'ReactFiberCommitWork' ) ;
41
41
var ReactFiberHostContext = require ( 'ReactFiberHostContext' ) ;
42
42
var ReactCurrentOwner = require ( 'ReactCurrentOwner' ) ;
43
+ var ReactFeatureFlags = require ( 'ReactFeatureFlags' ) ;
43
44
var getComponentName = require ( 'getComponentName' ) ;
44
45
45
46
var { cloneFiber } = require ( 'ReactFiber' ) ;
@@ -628,6 +629,18 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(config : HostConfig<T, P,
628
629
nextUnitOfWork = findNextUnitOfWork ( ) ;
629
630
}
630
631
632
+ let hostRootTimeMarker ;
633
+ if (
634
+ ReactFeatureFlags . logTopLevelRenders &&
635
+ nextUnitOfWork &&
636
+ nextUnitOfWork . tag === HostRoot &&
637
+ nextUnitOfWork . child
638
+ ) {
639
+ const componentName = getComponentName ( nextUnitOfWork . child ) || '' ;
640
+ hostRootTimeMarker = 'React update: ' + componentName ;
641
+ console . time ( hostRootTimeMarker ) ;
642
+ }
643
+
631
644
// If there's a deadline, and we're not performing Task work, perform work
632
645
// using this loop that checks the deadline on every iteration.
633
646
if ( deadline && priorityLevel > TaskPriority ) {
@@ -673,6 +686,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(config : HostConfig<T, P,
673
686
}
674
687
}
675
688
689
+ if ( hostRootTimeMarker ) {
690
+ console . timeEnd ( hostRootTimeMarker ) ;
691
+ }
692
+
676
693
return deadlineHasExpired ;
677
694
}
678
695
0 commit comments