Skip to content
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

perf(runtime-core): optimize the performance of getTypeIndex #3206

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Feb 9, 2021

@HcySunYang HcySunYang added the 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. label Mar 29, 2021
@yyx990803 yyx990803 merged commit 2e50acf into vuejs:master Mar 30, 2021
@yyx990803
Copy link
Member

Hmm, I didn't realize findIndex is so much faster in Chrome and Safari. V8 and JavaScriptCore probably have some dedicated fast paths for it. It's slighlty slower in Firefox but seems to be worthwhile.

There are many places in the codebase where I was intentionally using for loops for performance reasons - we may want to find other occurrences where native Array methods is faster than the for counterparts and refactor those as well.

Also note: this won't work in IE11, but merging it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants