Skip to content

Conversation

hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Oct 10, 2025

Fixes #34770.

We need to clear measures at some point, otherwise all these copies of props that we end up recording will allocate too much memory in Chromium. This adds performance.clearMeasures(...) calls to such cases in DEV.

We can also consider clearing all measures. The only drawback I can think of right now is that they won't be available in performance.getEntries() and PerformanceObserver, but that doesn't really make any sense for DEV envs.

Validated that entries are still shown on Performance panel timeline.

@hoxyq hoxyq requested review from eps1lon and sebmarkbage October 10, 2025 18:14
@meta-cla meta-cla bot added the CLA Signed label Oct 10, 2025
};

const resuableChangedPropsEntry = ['Changed Props', ''];
const reusableChangedPropsEntry = ['Changed Props', ''];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

drive-by typo fix

@react-sizebot
Copy link

Comparing: 8454a32...0d9a0b5

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 = 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 0d9a0b5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Massive memory allocations using React dev build under frequent updates (prod build unaffected)

2 participants