Skip to content

docs: initial docs for Performance tracks - #7938

Merged
hoxyq merged 4 commits into
mainfrom
docs/react-perf-tracks
Oct 1, 2025
Merged

docs: initial docs for Performance tracks#7938
hoxyq merged 4 commits into
mainfrom
docs/react-perf-tracks

Conversation

@hoxyq

@hoxyqhoxyq commented Aug 22, 2025

Copy link
Copy Markdown
Collaborator

Adds initial docs for React Performance tracks.

These docs cover only client-side tracks for now: Scheduler and Components.

@github-actions

github-actionsBot commented Aug 22, 2025

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

PageSize (compressed)First Load
/[[...markdownPath]]130.52 KB(🟡 +44 B)241.06 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@@ -0,0 +1,129 @@
---
title: React Performance tracks

@rubennorterubennorteSep 11, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: React Performance tracks
title: React performance tracks

It feels weird to capitalize performance. I'd either capitalize everything or just React. There are other examples of this in the doc.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is, Performance is capitalized here to align with "Performance panel" in the browser.

@rickhanlonii How do you feel about the naming?

Comment threadsrc/content/learn/react-performance-tracks.md Outdated

### Components {/*components*/}

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mention that not all components rendered are shown here. Only the ones taking more than a specific amount of time.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, added a note:

<Note>
Unlike renders, not all effects are shown on the Components track by default.
To maintain performance and prevent UI clutter, React will only display those effects, which had a duration of 0.05ms or longer, or triggered an update.
</Note>

I am working on a feature that will record effects that triggered an update, independent of their duration

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding that note, are we showing all components rendered, but not all effects, or are we also not showing all the renders?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All renders are showed, independent from their corresponding duration.

Not all effects are showed. With react/react#34648, we won't show the ones that took 0.05ms or less and didn't trigger any blocking updates.

@hoxyq
hoxyqforce-pushed the docs/react-perf-tracks branch from 5f43f3f to 7820e43CompareSeptember 29, 2025 14:43
@hoxyq
hoxyq marked this pull request as ready for review September 29, 2025 14:44
@hoxyq
hoxyqforce-pushed the docs/react-perf-tracks branch from 7820e43 to 9f95da2CompareSeptember 29, 2025 15:08
@hoxyqhoxyq changed the title docs: scaffold docs structure for Performance tracksdocs: initial docs for Performance tracksSep 29, 2025
@hoxyq
hoxyqforce-pushed the docs/react-perf-tracks branch from 5df064d to d2b6b67CompareSeptember 30, 2025 15:44

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:

- **Blocking** - The synchronous updates, which could've been initiated by user interactions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State updates from commits (layout effects, ref assignments, etc.) are also scheduled with a blocking priority. We should probably mention that too.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "The synchronous updates" are referring to the application updates, not to the state updates.

I am not sure how to update it to clarify it more

Comment threadsrc/content/reference/developer-tooling/react-performance-tracks.md Outdated
<img className="w-full dark-image" src="/images/docs/performance-tracks/scheduler-cascading-update.dark.png" alt="Scheduler track: cascading updates" />
</div>

[Learn more about Effects](/learn/you-might-not-need-an-effect).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a concrete example we can link to instead? Maybe even with a backlink telling people to use the profiler to spot cascading updates?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a section that explains fully the cascading updates. Only a small paragraph on https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state, where it is briefly mentioned.

That's a great idea for a separate task, we could add a section to it that explains how cascading updates could be spotted with Performance tracks. Will follow up.

Comment threadsrc/content/reference/developer-tooling/react-performance-tracks.md Outdated
Comment threadsrc/content/reference/developer-tooling/react-performance-tracks.md Outdated
@hoxyq
hoxyq merged commit 9fddeca into mainOct 1, 2025
6 checks passed
@hoxyq
hoxyq deleted the docs/react-perf-tracks branch October 1, 2025 12:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hoxyq@rubennorte@jackpope@eps1lon