Skip to content

Move the Error creation to be lazy - #24728

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:errorstacksforabort
Jun 15, 2022
Merged

Move the Error creation to be lazy#24728
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:errorstacksforabort

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

Creating an Error captures a stack trace which can be somewhat expensive. We shouldn't do that twice for every render.

This also ensures that the stack trace is more useful because you can follow through the Node.js code to see the cause.

Creating an Error captures a stack trace which can be somewhat expensive.
We shouldn't do tthat always for every render.

This also ensures that the stack trace is more useful because you can
follow through the Node.js code to see the cause.
@sizebot

sizebot commented Jun 14, 2022

Copy link
Copy Markdown

Comparing: 256aefb...938a702

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.min.js = 131.76 kB 131.76 kB = 42.31 kB 42.31 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 137.03 kB 137.03 kB = 43.90 kB 43.90 kB
facebook-www/ReactDOM-prod.classic.js = 440.91 kB 440.91 kB = 80.63 kB 80.63 kB
facebook-www/ReactDOM-prod.modern.js = 426.21 kB 426.21 kB = 78.44 kB 78.44 kB
facebook-www/ReactDOMForked-prod.classic.js = 441.61 kB 441.61 kB = 80.85 kB 80.85 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 938a702

@sebmarkbage
sebmarkbage merged commit 522f473 into react:main Jun 15, 2022
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
Creating an Error captures a stack trace which can be somewhat expensive.
We shouldn't do tthat always for every render.

This also ensures that the stack trace is more useful because you can
follow through the Node.js code to see the cause.
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.

4 participants