@@ -40,6 +40,7 @@ var ReactFiberCompleteWork = require('ReactFiberCompleteWork');
4040var ReactFiberCommitWork = require ( 'ReactFiberCommitWork' ) ;
4141var ReactFiberHostContext = require ( 'ReactFiberHostContext' ) ;
4242var ReactCurrentOwner = require ( 'ReactCurrentOwner' ) ;
43+ var ReactFeatureFlags = require ( 'ReactFeatureFlags' ) ;
4344var getComponentName = require ( 'getComponentName' ) ;
4445
4546var { cloneFiber } = require ( 'ReactFiber' ) ;
@@ -628,6 +629,18 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(config : HostConfig<T, P,
628629 nextUnitOfWork = findNextUnitOfWork ( ) ;
629630 }
630631
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+
631644 // If there's a deadline, and we're not performing Task work, perform work
632645 // using this loop that checks the deadline on every iteration.
633646 if ( deadline && priorityLevel > TaskPriority ) {
@@ -673,6 +686,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(config : HostConfig<T, P,
673686 }
674687 }
675688
689+ if ( hostRootTimeMarker ) {
690+ console . timeEnd ( hostRootTimeMarker ) ;
691+ }
692+
676693 return deadlineHasExpired ;
677694 }
678695
0 commit comments