Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Log yielded time in the Component Track - #31563

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase
Nov 19, 2024
Merged

Log yielded time in the Component Track#31563
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:yieldphase

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Stacked on #31552. Must be tested with enableSiblingPrerendering off since the use() optimization is not on there yet.

This adds a span to the Components track when we yield in the middle of the event loop. In this scenario, the "Render" span continues through out the Scheduler track. So you can see that the Component itself might not take a long time but yielding inside of it might.

This lets you see if something was blocking the React render loop while yielding. If we're blocked 1ms or longer we log that as "Blocked".

If we're yielding due to suspending in the middle of the work loop we log this as "Suspended".

Screenshot 2024-11-16 at 1 15 14 PM

If the render doesn't commit because it restarts due to some other prewarming or because some non-use() suspends, it doesn't have from context components.

Screenshot 2024-11-16 at 1 13 55 PM

The useActionState path doesn't work yet because the use() optimization doesn't work there for some reason. But the idea is that it should mark the time that the component is blocked as Action instead of Suspended.

@vercel

vercelBot commented Nov 16, 2024

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
react-compiler-playground✅ Ready (Inspect)Visit Preview💬 Add feedbackNov 19, 2024 6:45pm

@react-sizebot

react-sizebot commented Nov 16, 2024

Copy link
Copy Markdown

Comparing: 6177b18c66c010d2b2f03202623a0533e7a89004...0d4052a432b7b8119b342811fd3062f9c6ac8855

Critical size changes

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

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.68 kB6.68 kB=1.83 kB1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js=509.94 kB509.94 kB=91.24 kB91.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.69 kB6.69 kB=1.83 kB1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=514.88 kB514.88 kB=91.95 kB91.95 kB
facebook-www/ReactDOM-prod.classic.js=594.55 kB594.55 kB=104.89 kB104.90 kB
facebook-www/ReactDOM-prod.modern.js=584.81 kB584.81 kB=103.32 kB103.32 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js+0.32%429.88 kB431.28 kB+0.23%69.69 kB69.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js+0.27%662.37 kB664.13 kB+0.18%105.97 kB106.16 kB
oss-experimental/react-art/cjs/react-art.development.js+0.25%579.62 kB581.08 kB+0.18%93.48 kB93.64 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js+0.24%557.25 kB558.59 kB+0.20%98.94 kB99.14 kB

Generated by 🚫 dangerJS against 112f44b

@sebmarkbage

Copy link
Copy Markdown
ContributorAuthor

I kind of want a different color for this but I'm using secondary (purple) to mean commit phase and the component track also has commit phase. I use warning (yellow) to mean event and that should ideally stick how so you can easily find real interactions. I want to use ternary (green) to mean Hydrated.

Comment on lines +120 to +123
if (yieldDuration < 1) {
// Skip sub-millisecond yields. This happens all the time and is not interesting.
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do these become >=1ms when CPU throttling is turned on?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe for the really slow ones. Depends on the overhead of yielding on the platform I guess.

Comment on lines +126 to +130
yieldDuration < 5
? 'primary-light'
: yieldDuration < 10
? 'primary'
: yieldDuration < 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do we decide the numeric value of these thresholds?

@sebmarkbagesebmarkbageNov 19, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Originally the render time ones are <1, <10, <100, and above.

This comes from that a typical component should really be less then 1ms. If it's less than 10 you can still comfortably fit the rendering within a frame with some additional overhead but that's still very high for a single component. You can do a lot in 10ms. That still lets you do JS based animations.

Above that you're starting to be unable to do JS animations without dropping frames. Approaching error territory but ideally an event should respond in about 50ms. If on average your click hits in the middle of 100ms, and we yield 50ms after that. Assuming the response renders fast after that, you're still within the range of feeling responsive so it's ok. But that's the very top end.

Above 100ms you're really in error territory. You can no longer be responsive to new input.

The effect ones are more permissive because they are expected to kind of happen in the seams like when you commit a brand new page rather than in the background or continuously. E.g. the animation probably just finished and is about to restart. However, we probably should maybe lower this for Blocking lane because a long commit in blocking lane is also not good because it's likely to maybe happen more repeatedly.

For yields I'm trying to mirror the time coloring of component render. In that case it's something else blocking us so whatever that is has the same constraints as we do. However, it's more likely to have small little 1-5ms yields due to some little timer or something yielding that I increased the minimum number a little bit.

@sebmarkbage
sebmarkbage merged commit 7c254b6 into react:mainNov 19, 2024
cipolleschi added a commit to cipolleschi/metro that referenced this pull request Dec 11, 2024
Summary:
X-link: react/react-native#48196
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
facebook-github-bot pushed a commit to react/metro that referenced this pull request Dec 16, 2024
Summary:
X-link: react/react-native#48196
Pull Request resolved: #1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48196
X-link: react/metro#1400
- **[372ec00c03](react/react@372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](react/react#31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](react/react@3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](react/react#31713)) //<Sebastian Markbåge>//
- **[1c9b138714](react/react@1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](react/react#31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](react/react@de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](react/react#31667)) //<Josh Story>//
- **[16d2bbbd1f](react/react@16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](react/react#31620)) //<Josh Story>//
- **[5b0ef217ef](react/react@5b0ef217ef )**: s/server action/server function ([#31005](react/react#31005)) //<Ricky>//
- **[e3b7ef32be](react/react@e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](react/react#31617)) //<lauren>//
- **[aba370f1e4](react/react@aba370f1e4 )**: Add moveBefore Experiment ([#31596](react/react#31596)) //<Sebastian Markbåge>//
- **[1345c37941](react/react@1345c37941 )**: Mark all lanes in order on every new render ([#31615](react/react#31615)) //<Sebastian Markbåge>//
- **[91061073d5](react/react@91061073d5 )**: Mark ping time as update ([#31611](react/react#31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](react/react@a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](react/react#31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](react/react@c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](react/react#31599)) //<lauren>//
- **[64f89510af](react/react@64f89510af )**: [crud] Enable on RTR FB builds ([#31590](react/react#31590)) //<lauren>//
- **[7558ffe84d](react/react@7558ffe84d )**: [crud] Fix copy paste typo ([#31588](react/react#31588)) //<lauren>//
- **[7c254b6576](react/react@7c254b6576 )**: Log yielded time in the Component Track ([#31563](react/react#31563)) //<Sebastian Markbåge>//
- **[6177b18c66](react/react@6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](react/react#31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](react/react@eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](react/react#31119)) //<Mark Skelton>//
- **[047d95e85f](react/react@047d95e85f )**: [crud] Basic implementation ([#31523](react/react#31523)) //<lauren>//
- **[92c0f5f85f](react/react@92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](react/react#31554)) //<Sebastian Markbåge>//
- **[053b3cb050](react/react@053b3cb050 )**: [crud] Rename Effect type ([#31557](react/react#31557)) //<lauren>//
- **[7dd6b9e68a](react/react@7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](react/react#31556)) //<lauren>//
- **[d8afd1c82e](react/react@d8afd1c82e )**: [crud] Scaffold initial types ([#31555](react/react#31555)) //<lauren>//
- **[3720870a97](react/react@3720870a97 )**: Log Render Phases that Never Committed ([#31548](react/react#31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](react/react@8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path ([#31547](react/react#31547)) //<Sebastian Markbåge>//
- **[63cde684f5](react/react@63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](react/react#31524)) //<Zack Tanner>//
- **[b01722d585](react/react@b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](react/react#31536)) //<Sebastian Markbåge>//
- **[c13986da78](react/react@c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](react/react#31528)) //<Sebastian Markbåge>//
- **[4686872159](react/react@4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](react/react#31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](react/react@5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](react/react#31540)) //<lauren>//
- **[3644f0bd21](react/react@3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](react/react#31527)) //<Sebastian Markbåge>//
- **[8657869999](react/react@8657869999 )**: Separate Tracks for Components and Phases ([#31525](react/react#31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](react/react@b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](react/react#31539)) //<lauren>//
Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0
bypass-github-export-checks
jest_e2e[run_all_tests]
Reviewed By: cortinico
Differential Revision: D67018480
fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sebmarkbage@react-sizebot@eps1lon@facebook-github-bot