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/reference/developer-tooling/react-performance-tracks.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,14 @@ These tracks are designed to provide developers with comprehensive insights into
33
33
React Performance tracks are only available in development and profiling builds of React:
34
34
35
35
-**Development**: enabled by default.
36
-
-**Profiling**: you can either wrap a subtree that you want to instrument with [`<Profiler>`](/reference/react/Profiler) component or have [React Developer Tools extension](/learn/react-developer-tools) enabled.
36
+
-**Profiling**: you can either wrap a subtree that you want to instrument with [`<Profiler>`](/reference/react/Profiler) component or have [React Developer Tools extension](/learn/react-developer-tools) enabled. Tracks specific to React Server Components are not enabled in profiling builds.
37
37
38
38
If enabled, tracks 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).
39
39
40
40
<Pitfall>
41
41
42
42
The profiling instrumentation that powers React Performance tracks adds some additional overhead, so it is disabled in production builds by default.
43
+
Server Components and Server Requests tracks are only available in development builds.
43
44
44
45
</Pitfall>
45
46
@@ -129,3 +130,32 @@ In development builds, when you click on a component render entry, you can inspe
<imgclassName="w-full light-image"src="/images/docs/performance-tracks/server-overview.png"alt="React Server Performance Tracks" />
138
+
<imgclassName="w-full dark-image"src="/images/docs/performance-tracks/server-overview.dark.png"alt="React Server Performance Tracks" />
139
+
</div>
140
+
141
+
#### Server Requests {/*server-requests*/}
142
+
143
+
The Server Requests track visualized all Promises that eventually end up in a React Server Component. This includes any `async` operations like calling `fetch` or async Node.js file operations.
144
+
145
+
React will try to combine Promises that are started from inside third-party code into a single span representing the the duration of the entire operation blocking 1st party code.
146
+
For example, a third party library method called `getUser` that calls `fetch` internally multiple times will be represented as a single span called `getUser`, instead of showing multiple `fetch` spans.
147
+
148
+
Clicking on spans will show you a stack trace of where the Promise was created as well as a view of the value that the Promise resolved to, if available.
149
+
150
+
Rejected Promises are displayed as red with their rejected value.
151
+
152
+
#### Server Components {/*server-components*/}
153
+
154
+
The Server Components tracks visualize the durations of React Server Components Promises they awaited. Timings are displayed as a flamegraph, where each entry represents the duration of the corresponding component render and all its descendant children components.
155
+
156
+
If you await a Promise, React will display duration of that Promise. To see all I/O operations, use the Server Requests track.
157
+
158
+
Different colors are used to indicate the duration of the component render. The darker the color, the longer the duration.
159
+
160
+
The Server Components track group will always contain a "Primary" track. If React is able to render Server Components concurrently, it will display addititional "Parallel" tracks.
161
+
If more than 8 Server Components are rendered concurrently, React will associate them with the last "Parallel" track instead of adding more tracks.
0 commit comments