Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Sep 17, 2025

Stacked on #34509.

View Transitions introduces a bunch of new types of gaps in the commit phase which needs to be logged differently in the performance track.

One thing that can happen is that a flushSync update forces the View Transition to abort before it has started if it happens in the gap before the transition is ready. In that case we log "Interrupted View Transition".

Otherwise, when we're done in startViewTransition there's some work to finalize the animations before the ready calllback. This is logged as "Starting Animation".

Then there's a gap before the passive effects fire which we log as "Animating". This can be long unless they're forced to flush early e.g. due to another lane updating.

The "Animating" track should then pick up which doesn't do yet. This one is tricky because this is after the actual commit phase and needs to be interrupted by new renders which themselves can be suspended on the animation finshing.

This PR is just a subset of all the cases. Will need a lot more work.

Screenshot 2025-09-16 at 10 19 06 PM

Also give a name to anonymous entries to help debugging
This ensures that we can't log another consecutive event on
top of the first event which would overlap.

Normally we do this in finalizeRender but it's currently possible to
prepare a fresh stack that doesn't lead to a render which doesn't finalize.
After mutation and flush spawned work will be part of "Starting Animation"
or "Waiting for Paint".
… early or due to a delayed passive effect flush
@meta-cla meta-cla bot added the CLA Signed label Sep 17, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 17, 2025
@react-sizebot
Copy link

Comparing: 7899729...7cc3919

Critical size changes

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

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 534.32 kB 534.28 kB = 94.33 kB 94.31 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 663.64 kB 663.61 kB = 117.01 kB 116.99 kB
facebook-www/ReactDOM-prod.classic.js = 687.59 kB 687.53 kB = 121.04 kB 121.02 kB
facebook-www/ReactDOM-prod.modern.js = 678.02 kB 677.95 kB = 119.39 kB 119.37 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-art/cjs/react-art.development.js +0.55% 704.17 kB 708.05 kB +0.55% 111.25 kB 111.86 kB
react-native/implementations/ReactFabric-dev.fb.js +0.54% 759.57 kB 763.71 kB +0.53% 120.76 kB 121.40 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js +0.54% 768.15 kB 772.29 kB +0.53% 121.98 kB 122.63 kB
facebook-www/ReactART-dev.modern.js +0.53% 746.85 kB 750.80 kB +0.53% 116.60 kB 117.22 kB
facebook-www/ReactART-dev.classic.js +0.52% 756.38 kB 760.32 kB +0.54% 118.35 kB 118.99 kB
facebook-www/ReactReconciler-dev.modern.js +0.50% 864.24 kB 868.52 kB +0.54% 133.78 kB 134.50 kB
facebook-www/ReactReconciler-dev.classic.js +0.49% 873.47 kB 877.76 kB +0.52% 135.52 kB 136.23 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.47% 834.24 kB 838.12 kB +0.46% 130.41 kB 131.00 kB
react-native/implementations/ReactFabric-profiling.fb.js +0.45% 455.66 kB 457.71 kB +0.46% 76.20 kB 76.55 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js +0.45% 462.13 kB 464.19 kB +0.47% 77.11 kB 77.47 kB
facebook-react-native/react-dom/cjs/ReactDOMClient-dev.js +0.39% 1,134.98 kB 1,139.46 kB +0.36% 187.51 kB 188.18 kB
facebook-react-native/react-dom/cjs/ReactDOMProfiling-dev.js +0.39% 1,151.25 kB 1,155.73 kB +0.35% 190.32 kB 190.99 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js +0.38% 546.70 kB 548.80 kB +0.35% 85.56 kB 85.86 kB
facebook-react-native/react-dom/cjs/ReactDOMClient-profiling.js +0.36% 662.31 kB 664.69 kB +0.30% 113.54 kB 113.88 kB
facebook-react-native/react-dom/cjs/ReactDOMProfiling-profiling.js +0.36% 668.25 kB 670.62 kB +0.29% 114.70 kB 115.03 kB
facebook-www/ReactDOM-dev.modern.js +0.34% 1,255.70 kB 1,259.98 kB +0.35% 207.25 kB 207.98 kB
facebook-www/ReactDOM-dev.classic.js +0.34% 1,264.87 kB 1,269.15 kB +0.37% 208.98 kB 209.75 kB
facebook-www/ReactDOMTesting-dev.modern.js +0.34% 1,272.23 kB 1,276.51 kB +0.36% 210.99 kB 211.74 kB
oss-experimental/react-dom/cjs/react-dom-client.development.js +0.34% 1,215.91 kB 1,219.99 kB +0.26% 202.72 kB 203.24 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js +0.33% 729.25 kB 731.69 kB +0.23% 126.68 kB 126.97 kB
facebook-www/ReactDOMTesting-dev.classic.js +0.33% 1,281.40 kB 1,285.68 kB +0.36% 212.75 kB 213.52 kB
oss-experimental/react-dom/cjs/react-dom-profiling.development.js +0.33% 1,232.29 kB 1,236.37 kB +0.25% 205.52 kB 206.04 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.33% 1,232.45 kB 1,236.53 kB +0.26% 206.31 kB 206.84 kB
facebook-www/ReactDOM-profiling.modern.js +0.27% 752.69 kB 754.75 kB +0.27% 129.54 kB 129.89 kB
facebook-www/ReactDOM-profiling.classic.js +0.27% 760.79 kB 762.85 kB +0.27% 130.92 kB 131.27 kB

Generated by 🚫 dangerJS against 7cc3919

return;
}
if (enableProfilerTimer && enableComponentPerformanceTrack) {
// If we didn't skip the after mutation phase, when is means we started an animation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// If we didn't skip the after mutation phase, when is means we started an animation.
// If we didn't skip the after mutation phase, then this means we started an animation.

@sebmarkbage sebmarkbage merged commit 84af908 into facebook:main Sep 17, 2025
247 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 17, 2025
Stacked on #34509.

View Transitions introduces a bunch of new types of gaps in the commit
phase which needs to be logged differently in the performance track.

One thing that can happen is that a `flushSync` update forces the View
Transition to abort before it has started if it happens in the gap
before the transition is ready. In that case we log "Interrupted View
Transition".

Otherwise, when we're done in `startViewTransition` there's some work to
finalize the animations before the `ready` calllback. This is logged as
"Starting Animation".

Then there's a gap before the passive effects fire which we log as
"Animating". This can be long unless they're forced to flush early e.g.
due to another lane updating.

The "Animating" track should then pick up which doesn't do yet. This one
is tricky because this is after the actual commit phase and needs to be
interrupted by new renders which themselves can be suspended on the
animation finshing.

This PR is just a subset of all the cases. Will need a lot more work.

<img width="679" height="161" alt="Screenshot 2025-09-16 at 10 19 06 PM"
src="https://github.com/user-attachments/assets/0407372d-aaed-41f5-a262-059b2686ae87"
/>

DiffTrain build for [84af908](84af908)
github-actions bot pushed a commit that referenced this pull request Sep 17, 2025
Stacked on #34509.

View Transitions introduces a bunch of new types of gaps in the commit
phase which needs to be logged differently in the performance track.

One thing that can happen is that a `flushSync` update forces the View
Transition to abort before it has started if it happens in the gap
before the transition is ready. In that case we log "Interrupted View
Transition".

Otherwise, when we're done in `startViewTransition` there's some work to
finalize the animations before the `ready` calllback. This is logged as
"Starting Animation".

Then there's a gap before the passive effects fire which we log as
"Animating". This can be long unless they're forced to flush early e.g.
due to another lane updating.

The "Animating" track should then pick up which doesn't do yet. This one
is tricky because this is after the actual commit phase and needs to be
interrupted by new renders which themselves can be suspended on the
animation finshing.

This PR is just a subset of all the cases. Will need a lot more work.

<img width="679" height="161" alt="Screenshot 2025-09-16 at 10 19 06 PM"
src="https://github.com/user-attachments/assets/0407372d-aaed-41f5-a262-059b2686ae87"
/>

DiffTrain build for [84af908](84af908)
sebmarkbage added a commit that referenced this pull request Sep 18, 2025
Stacked on #34510.

The "Commit" phase for a View Transition starts before the snapshot
phase (before mutation) and then stretches into the async gap of
`startViewTransition`, encompasses the mutation phase inside of its
update callback and finally the layout phase.

However, between the mutation phase and the layout phase we may suspend
the start of the view transition on fonts and/or images. In that case we
now split the Commit phase into first one before we suspend and then we
log "Waiting for Images and/or Fonts" and then another Commit phase
around the layout effects.

<img width="897" height="119" alt="Screenshot 2025-09-16 at 11 37 26 PM"
src="https://github.com/user-attachments/assets/0fe21388-bb48-4456-a594-62227d12d9b7"
/>
github-actions bot pushed a commit that referenced this pull request Sep 18, 2025
Stacked on #34510.

The "Commit" phase for a View Transition starts before the snapshot
phase (before mutation) and then stretches into the async gap of
`startViewTransition`, encompasses the mutation phase inside of its
update callback and finally the layout phase.

However, between the mutation phase and the layout phase we may suspend
the start of the view transition on fonts and/or images. In that case we
now split the Commit phase into first one before we suspend and then we
log "Waiting for Images and/or Fonts" and then another Commit phase
around the layout effects.

<img width="897" height="119" alt="Screenshot 2025-09-16 at 11 37 26 PM"
src="https://github.com/user-attachments/assets/0fe21388-bb48-4456-a594-62227d12d9b7"
/>

DiffTrain build for [ad578aa](ad578aa)
github-actions bot pushed a commit that referenced this pull request Sep 18, 2025
Stacked on #34510.

The "Commit" phase for a View Transition starts before the snapshot
phase (before mutation) and then stretches into the async gap of
`startViewTransition`, encompasses the mutation phase inside of its
update callback and finally the layout phase.

However, between the mutation phase and the layout phase we may suspend
the start of the view transition on fonts and/or images. In that case we
now split the Commit phase into first one before we suspend and then we
log "Waiting for Images and/or Fonts" and then another Commit phase
around the layout effects.

<img width="897" height="119" alt="Screenshot 2025-09-16 at 11 37 26 PM"
src="https://github.com/user-attachments/assets/0fe21388-bb48-4456-a594-62227d12d9b7"
/>

DiffTrain build for [ad578aa](ad578aa)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Sep 21, 2025
Stacked on facebook#34509.

View Transitions introduces a bunch of new types of gaps in the commit
phase which needs to be logged differently in the performance track.

One thing that can happen is that a `flushSync` update forces the View
Transition to abort before it has started if it happens in the gap
before the transition is ready. In that case we log "Interrupted View
Transition".

Otherwise, when we're done in `startViewTransition` there's some work to
finalize the animations before the `ready` calllback. This is logged as
"Starting Animation".

Then there's a gap before the passive effects fire which we log as
"Animating". This can be long unless they're forced to flush early e.g.
due to another lane updating.

The "Animating" track should then pick up which doesn't do yet. This one
is tricky because this is after the actual commit phase and needs to be
interrupted by new renders which themselves can be suspended on the
animation finshing.

This PR is just a subset of all the cases. Will need a lot more work.

<img width="679" height="161" alt="Screenshot 2025-09-16 at 10 19 06 PM"
src="https://github.com/user-attachments/assets/0407372d-aaed-41f5-a262-059b2686ae87"
/>

DiffTrain build for [84af908](facebook@84af908)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Sep 21, 2025
Stacked on facebook#34509.

View Transitions introduces a bunch of new types of gaps in the commit
phase which needs to be logged differently in the performance track.

One thing that can happen is that a `flushSync` update forces the View
Transition to abort before it has started if it happens in the gap
before the transition is ready. In that case we log "Interrupted View
Transition".

Otherwise, when we're done in `startViewTransition` there's some work to
finalize the animations before the `ready` calllback. This is logged as
"Starting Animation".

Then there's a gap before the passive effects fire which we log as
"Animating". This can be long unless they're forced to flush early e.g.
due to another lane updating.

The "Animating" track should then pick up which doesn't do yet. This one
is tricky because this is after the actual commit phase and needs to be
interrupted by new renders which themselves can be suspended on the
animation finshing.

This PR is just a subset of all the cases. Will need a lot more work.

<img width="679" height="161" alt="Screenshot 2025-09-16 at 10 19 06 PM"
src="https://github.com/user-attachments/assets/0407372d-aaed-41f5-a262-059b2686ae87"
/>

DiffTrain build for [84af908](facebook@84af908)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants