Skip to content

Conversation

@eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Oct 12, 2025

If we rerender with the same props, the render time will not be accounted for in the Components track. The attached test reproduces the behavior observed in https://codesandbox.io/p/sandbox/patient-fast-j94f2g:
CleanShot 2025-10-13 at 00 13 41@2x

@meta-cla meta-cla bot added the CLA Signed label Oct 12, 2025
});

// @gate __DEV__ && enableComponentPerformanceTrack
it('includes spans for Components with no prop changes', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually doesn't at the moment but prob should?

@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Oct 12, 2025
Comment on lines +420 to +438
},
end: 21000,
start: 16000,
},
],
]);
expect(getConsoleTimestampEntries()).toEqual([
['Render', 16000, 31000, 'Blocking', 'Scheduler ⚛', 'primary-dark'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

15s in the Scheduler track but only 5s are accounted for (in <Left> where props changed). The other 10s of <Right> are omitted. Ideally they would show with a hint that no props changed and the Component should be memoized. Or refactored since a large amount of time spent in a Component with no props changed hints at some expensive work in its impl that couldn't be memoized.

@react-sizebot
Copy link

react-sizebot commented Oct 12, 2025

Comparing: ead9218...abffa5c

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.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 604.98 kB 604.98 kB = 107.14 kB 107.14 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.95 kB 663.95 kB = 117.03 kB 117.03 kB
facebook-www/ReactDOM-prod.classic.js = 687.81 kB 687.81 kB = 121.07 kB 121.07 kB
facebook-www/ReactDOM-prod.modern.js = 678.24 kB 678.24 kB = 119.42 kB 119.42 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against abffa5c

@eps1lon eps1lon force-pushed the sebbie/components-track-unchanged-props branch from 1ee4714 to abffa5c Compare October 12, 2025 22:27
@eps1lon eps1lon marked this pull request as ready for review October 12, 2025 22:27
@eps1lon eps1lon requested review from hoxyq and sebmarkbage October 12, 2025 22:27
@sebmarkbage
Copy link
Collaborator

sebmarkbage commented Oct 13, 2025

This is a refactoring bug introduced by #34370

It used to be that we fell through to the console.timeStamp if there were no diffs but now there's a missing else case that forgets to log.

By getting rid of the early return we'd have to copy paste the else case to all the ifs.

Copy link
Contributor

@hoxyq hoxyq left a comment

Choose a reason for hiding this comment

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

Oops, sorry about the missing branch!

Are you working on a fix for it, or I could take a look, if you want me to?

@eps1lon
Copy link
Collaborator Author

eps1lon commented Oct 13, 2025

Are you working on a fix for it, or I could take a look, if you want me to?

That'd be nice. I'm not actively working on a fix.

@hoxyq hoxyq merged commit 7b971c0 into facebook:main Oct 13, 2025
243 of 244 checks passed
@eps1lon eps1lon deleted the sebbie/components-track-unchanged-props branch October 13, 2025 21:17
hoxyq added a commit that referenced this pull request Oct 13, 2025
Stacked on #34822.
Fixes a bug introduced in #34370.

Just copying the lower else branch to the `properties.length` else
branch at the top.
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
Stacked on #34822.
Fixes a bug introduced in #34370.

Just copying the lower else branch to the `properties.length` else
branch at the top.

DiffTrain build for [47905a7](47905a7)
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
Stacked on #34822.
Fixes a bug introduced in #34370.

Just copying the lower else branch to the `properties.length` else
branch at the top.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants