Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fiber] Color Performance Track Entries by Self Time #30984

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

sebmarkbage
Copy link
Collaborator

Stacked on #30983.

This colors each component entry by its self time from light to dark depending on how long it took. If it took longer than a cut off we color it red (the error color).

Screenshot 2024-09-16 at 11 48 15 PM

Copy link

vercel bot commented Sep 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 8:19pm

@react-sizebot
Copy link

react-sizebot commented Sep 17, 2024

Comparing: e1c2090...0d782cc

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.11% 1.82 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 508.56 kB 508.59 kB = 91.03 kB 91.04 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 513.53 kB 513.53 kB = 91.75 kB 91.75 kB
facebook-www/ReactDOM-prod.classic.js = 602.91 kB 602.95 kB = 106.73 kB 106.73 kB
facebook-www/ReactDOM-prod.modern.js = 579.18 kB 579.18 kB = 102.85 kB 102.85 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 665efad

@@ -54,6 +54,44 @@ export function logComponentRender(
return;
}
if (supportsUserTiming) {
let selfTime: number = (fiber.actualDuration: any);
for (let child = fiber.child; child !== null; child = child.sibling) {
selfTime -= (child.actualDuration: any);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't love this loop for every rendered component. We could maybe change how we keep track of this but that might require another field. We could also maybe keep track of this by reusing the commit loop.

@sebmarkbage sebmarkbage merged commit 8dfbd16 into facebook:main Sep 17, 2024
184 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 17, 2024
Stacked on #30983.

This colors each component entry by its self time from light to dark
depending on how long it took. If it took longer than a cut off we color
it red (the error color).

<img width="435" alt="Screenshot 2024-09-16 at 11 48 15 PM"
src="https://github.com/user-attachments/assets/5d0bda83-6205-40e9-bec1-b81db2d48b2d">

DiffTrain build for [8dfbd16](8dfbd16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants