Fiber logs timing for HostRoot if logTopLevelRenders enabled#8687
Fiber logs timing for HostRoot if logTopLevelRenders enabled#8687bvaughn merged 1 commit intofacebook:masterfrom
Conversation
|
@spicyj What is |
|
I think the intent is to annotate the Chrome Timeline view to make it easier to match frames to React components. Not just initial render but any updates (given that a0f88d2 added logging to |
|
This is really used as a FB specific feature to measure the overall initial render time when profiling. @spicyj Does this look like the right thing we want to measure? Basically for sync/task/animation mode it will log the reconciliation time for an update to a root. For deferred work, it'll measure the time of a particular slice. Do we still need this feature for Web Speed? I wonder if maybe we shouldn't do this for deferred priority work since those can't be measured as a single unit. |
sebmarkbage
left a comment
There was a problem hiding this comment.
Let's get this in for parity. I'm not sure if it will always measure something we're interested in but we can revert later.
Initial stab at calling console.time/console.timeEnd for the top level component when ReactFeatureFlags.logTopLevelRenders is enabled
b876fc2 to
a236a1a
Compare
Adds calls to
console.timeandconsole.timeEndbefore beginning work on the top-level (HostRoot) component ifReactFeatureFlags.logTopLevelRendersis enabled.Couple of concerns / open questions about this approach:
Update: This implementation potentially logs a single time entry for multiple roots, since
workLoopcallsfindNextUnitOfWorkwhich searches across roots. That's probably not what we want. Maybe we could only enable this logging whenuseSyncSchedulingis enabled?