You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/react-performance-tracks.md
+35-13Lines changed: 35 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,15 @@ Experimental versions of React may contain bugs. Don't use them in production.
19
19
20
20
<Intro>
21
21
22
-
React Performance tracks are specialized custom entries that appear on the [Performance panel's timeline of Chrome DevTools](https://developer.chrome.com/docs/devtools/performance/overview).
22
+
React Performance tracks are specialized custom entries that appear on the Performance panel's timeline.
23
23
24
24
</Intro>
25
25
26
26
These tracks are designed to provide developers with comprehensive insights into their React application's performance by visualizing React-specific events and metrics alongside other critical data sources such as Network requests, JavaScript execution, and Event Loop activity, all synchronized on a unified timeline within the Performance panel for a complete understanding of application behavior.
@@ -42,11 +36,11 @@ These tracks are designed to provide developers with comprehensive insights into
42
36
43
37
## Usage {/*usage*/}
44
38
45
-
You don't need to do anything to explicitly enable React Performance tracks. They are enabled by default in development and profiling builds of React and should appear by default in the traces you record with the Performance panel.
39
+
You don't need to do anything to explicitly enable React Performance tracks. They are enabled by default in development and profiling builds of React and should appear automatically in the traces you record with the Performance panel of browsers that provide [extensibility APIs](https://developer.chrome.com/docs/devtools/performance/extension).
46
40
47
41
<Pitfall>
48
42
49
-
Profiling instrumentation that powers React Performance tracks adds some additional overhead, so it is disabled in the production build by default.
43
+
The profiling instrumentation that powers React Performance tracks adds some additional overhead, so it is disabled in production builds by default.
50
44
51
45
</Pitfall>
52
46
@@ -56,8 +50,36 @@ Profiling instrumentation that powers React Performance tracks adds some additio
56
50
57
51
### Scheduler {/*scheduler*/}
58
52
59
-
🚧 Work in progress...
53
+
The Scheduler is an internal React concept used for managing tasks with different priorities. This track consists of 4 subtracks, each representing work of a specific priority:
54
+
55
+
-**Blocking** - The highest priority work that must be finished before the browser can paint.
56
+
-**Transition** - Non-blocking work that happens in the background, usually via [`startTransition`](/reference/react/startTransition).
57
+
-**Suspense** - Work related to Suspense boundaries, such as displaying fallbacks or revealing content.
58
+
-**Idle** - The lowest priority work that is done when there are no other tasks with higher priority.
59
+
60
+
🚧 `<screenshot>`
61
+
62
+
🚧 WIP: a sub-section about React update and phases.
60
63
61
64
### Components {/*components*/}
62
65
63
-
🚧 Work in progress...
66
+
The Components track visualizes the durations of React components. They are displayed as a flamegraph, where each entry represents the duration of the corresponding component render and all its descendant children components.
Similar to render durations, effect durations are also represented as a flamegraph, but with a different color scheme that aligns with the corresponding phase on the Scheduler track.
Additional events may be displayed during the render and effects phases:
81
+
82
+
- <span style={{padding: '0.125rem 0.25rem', backgroundColor: '#facc15', color: '#1f1f1fff'}}>Mount</span> - A corresponding subtree of component renders or effects was mounted.
83
+
- <span style={{padding: '0.125rem 0.25rem', backgroundColor: '#facc15', color: '#1f1f1fff'}}>Unmount</span> - A corresponding subtree of component renders or effects was unmounted.
84
+
- <span style={{padding: '0.125rem 0.25rem', backgroundColor: '#facc15', color: '#1f1f1fff'}}>Reconnect</span> - Similar to Mount, but limited to cases when [`<Activity>`](/reference/react/Activity) is used.
85
+
- <span style={{padding: '0.125rem 0.25rem', backgroundColor: '#facc15', color: '#1f1f1fff'}}>Disconnect</span> - Similar to Unmount, but limited to cases when [`<Activity>`](/reference/react/Activity) is used.
0 commit comments