-
Notifications
You must be signed in to change notification settings - Fork 46.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unmounting performance regression in __DEV__ #7463
Conversation
Quickly skimmed over it, nothing looks crazy. Stamping to unblock |
Was the try/catch difference noticeable? |
Not very much but it got |
I'm curious if just having a single handler in hooks and passing the name as an argument could be faster to avoid dynamic checks and lookups. |
That's actually a very big difference! How much do those numbers vary from run to run? |
To be honest I don’t remember about this particular commit (I’ve been testing many different ways, and some were more flaky than others). I can re-test it again in isolation later if you’d like. |
* Comment previous occurrences of this issue * Fix DEV performance regression in V8 * Extract try/catch into a separate function when calling hooks (cherry picked from commit afa27bc)
This is the same issue as was previously fixed by #7232, but in
__DEV__
.Test plan:
npm run build-dev
Before this change: ~6 seconds.
After this change: ~2 seconds.
This seems only relevant for Chrome.