Skip to content

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

Merged
merged 6 commits into from
Mar 2, 2023
Merged

Conversation

JoviDeCroock
Copy link
Member

  • hoist regexes
  • remove case insensitive regex

@coveralls
Copy link

coveralls commented Feb 18, 2023

Coverage Status

Coverage: 99.543% (+0.002%) from 99.541% when pulling 0b174dc on compat-optimizations into 950b239 on master.

@github-actions
Copy link

github-actions bot commented Feb 18, 2023

Size Change: +34 B (0%)

Total Size: 54.1 kB

Filename Size Change
compat/dist/compat.js 3.89 kB +14 B (0%)
compat/dist/compat.module.js 3.82 kB +7 B (0%)
compat/dist/compat.umd.js 3.96 kB +13 B (0%)
ℹ️ View Unchanged
Filename Size Change
debug/dist/debug.js 3 kB 0 B
debug/dist/debug.module.js 3.01 kB 0 B
debug/dist/debug.umd.js 3.08 kB 0 B
devtools/dist/devtools.js 231 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 314 B 0 B
dist/preact.js 4.21 kB 0 B
dist/preact.min.js 4.24 kB 0 B
dist/preact.min.module.js 4.24 kB 0 B
dist/preact.min.umd.js 4.26 kB 0 B
dist/preact.module.js 4.23 kB 0 B
dist/preact.umd.js 4.27 kB 0 B
hooks/dist/hooks.js 1.49 kB 0 B
hooks/dist/hooks.module.js 1.52 kB 0 B
hooks/dist/hooks.umd.js 1.57 kB 0 B
jsx-runtime/dist/jsxRuntime.js 360 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 326 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 441 B 0 B
test-utils/dist/testUtils.js 442 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 526 B 0 B

compressed-size-action

@andrewiggins
Copy link
Member

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)

@JoviDeCroock
Copy link
Member Author

@andrewiggins I measure these with importing compat during the rts benchmark

JoviDeCroock and others added 3 commits February 25, 2023 14:18
Co-authored-by: Andre Wiggins <459878+andrewiggins@users.noreply.github.com>
Comment on lines 17 to 19
const ON_BLUR = /^onblur$/;
const ON_FOCUS = /^onfocus$/;
const ON_INPUT = /^oninput$/;
Copy link
Member

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.

Copy link
Member Author

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 😅

@JoviDeCroock JoviDeCroock merged commit 5b7fb23 into master Mar 2, 2023
@JoviDeCroock JoviDeCroock deleted the compat-optimizations branch March 2, 2023 07:41
JoviDeCroock added a commit that referenced this pull request Jan 16, 2024
JoviDeCroock added a commit that referenced this pull request Jan 16, 2024
* backport #3911

* backport #3906

* backport #3837

* backport #3908

* backport #3904

* backport #3905

* backport #3898

* backport #3910

* backport #3948

* backport #3941

* backport #3945

* backport #3919

* backport #3922

* backport #3921

* backport #3903

* fix lint

* update more

* debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants