-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Trying a few compat optimizations #3903
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
Conversation
JoviDeCroock
commented
Feb 18, 2023
- hoist regexes
- remove case insensitive regex
Size Change: +34 B (0%) Total Size: 54.1 kB
ℹ️ View Unchanged
|
Oh also, do you have some way you are measuring these? It's on my list to build benchmarks for compat eventually lol (but that's a long ways away for now) |
@andrewiggins I measure these with importing compat during the rts benchmark |
Co-authored-by: Andre Wiggins <459878+andrewiggins@users.noreply.github.com>
af8f791
to
876b2e2
Compare
compat/src/render.js
Outdated
const ON_BLUR = /^onblur$/; | ||
const ON_FOCUS = /^onfocus$/; | ||
const ON_INPUT = /^oninput$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're lower-casing preemptively now, I bet we could get away with inlining these as straight equality checks (lowerCased === 'onfocus'
). Should be faster than the regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good shout, the camel props one is still the one hurting perf the most 😅