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

General performance improvements for folks using compat #4459

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Jul 27, 2024

  • Hoist the indexOf check to avoid the lookup
  • Guard all the event checks behind an event check
  • Lazily allocate the new props object some concerns with mutating props

Copy link

github-actions bot commented Jul 27, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-10.82ms - +3.48ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.09ms - +0.13ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-0.81ms - +2.15ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +1% (-0.46ms - +0.17ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -3% - +2% (-2.01ms - +1.58ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +3% (-0.10ms - +0.05ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +5% (-0.11ms - +1.19ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +1% (-1.43ms - +0.44ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +2% (-0.13ms - +0.33ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +0% (-0.03ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local866.15ms - 873.03ms-unsure 🔍
-1% - +0%
-10.82ms - +3.48ms
preact-main866.99ms - 879.53msunsure 🔍
-0% - +1%
-3.48ms - +10.82ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local25.15ms - 25.15ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main25.15ms - 25.15msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.65ms - 16.79ms-unsure 🔍
-1% - +1%
-0.09ms - +0.13ms
preact-main16.61ms - 16.78msunsure 🔍
-1% - +1%
-0.13ms - +0.09ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.70ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.70ms - 1.70msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local68.58ms - 71.33ms-unsure 🔍
-1% - +3%
-0.81ms - +2.15ms
preact-main68.73ms - 69.84msunsure 🔍
-3% - +1%
-2.15ms - +0.81ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local15.48ms - 15.90ms-unsure 🔍
-1% - +2%
-0.13ms - +0.33ms
preact-main15.50ms - 15.69msunsure 🔍
-2% - +1%
-0.33ms - +0.13ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.43ms - 16.78ms-unsure 🔍
-3% - +1%
-0.46ms - +0.17ms
preact-main16.49ms - 17.01msunsure 🔍
-1% - +3%
-0.17ms - +0.46ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.61ms - 4.62ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main4.61ms - 4.62msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local72.84ms - 75.46ms-unsure 🔍
-3% - +2%
-2.01ms - +1.58ms
preact-main73.14ms - 75.59msunsure 🔍
-2% - +3%
-1.58ms - +2.01ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.52ms - 3.55ms-unsure 🔍
-1% - +0%
-0.03ms - +0.02ms
preact-main3.53ms - 3.56msunsure 🔍
-0% - +1%
-0.02ms - +0.03ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local29.14ms - 29.99ms-unsure 🔍
-2% - +2%
-0.63ms - +0.62ms
preact-main29.11ms - 30.02msunsure 🔍
-2% - +2%
-0.62ms - +0.63ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local34.36ms - 36.41ms-unsure 🔍
-5% - +2%
-1.92ms - +0.87ms
preact-main34.96ms - 36.86msunsure 🔍
-2% - +5%
-0.87ms - +1.92ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local24.86ms - 25.46ms-unsure 🔍
-2% - +1%
-0.54ms - +0.28ms
preact-main25.01ms - 25.57msunsure 🔍
-1% - +2%
-0.28ms - +0.54ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local29.06ms - 30.70ms-unsure 🔍
-4% - +3%
-1.13ms - +0.95ms
preact-main29.34ms - 30.62msunsure 🔍
-3% - +4%
-0.95ms - +1.13ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local22.86ms - 24.82ms-unsure 🔍
-1% - +10%
-0.19ms - +2.20ms
preact-main22.16ms - 23.52msunsure 🔍
-9% - +1%
-2.20ms - +0.19ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local22.52ms - 23.44ms-unsure 🔍
-2% - +4%
-0.56ms - +0.89ms
preact-main22.26ms - 23.38msunsure 🔍
-4% - +2%
-0.89ms - +0.56ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.91ms - 2.00ms-unsure 🔍
-5% - +3%
-0.10ms - +0.05ms
preact-main1.92ms - 2.04msunsure 🔍
-3% - +5%
-0.05ms - +0.10ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.98ms - 0.98ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main0.98ms - 0.98msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local25.96ms - 27.23ms-unsure 🔍
-0% - +5%
-0.11ms - +1.19ms
preact-main25.94ms - 26.16msunsure 🔍
-4% - +0%
-1.19ms - +0.11ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.25ms - 1.25ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.25ms - 1.25msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local36.61ms - 38.13ms-unsure 🔍
-4% - +1%
-1.43ms - +0.44ms
preact-main37.31ms - 38.41msunsure 🔍
-1% - +4%
-0.44ms - +1.43ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.55ms - 3.55ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main3.55ms - 3.55msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link

github-actions bot commented Jul 27, 2024

Size Change: +47 B (+0.08%)

Total Size: 62 kB

Filename Size Change
compat/dist/compat.js 4.11 kB +15 B (+0.37%)
compat/dist/compat.module.js 4.04 kB +15 B (+0.37%)
compat/dist/compat.umd.js 4.18 kB +17 B (+0.41%)
ℹ️ View Unchanged
Filename Size
debug/dist/debug.js 3.7 kB
debug/dist/debug.module.js 3.71 kB
debug/dist/debug.umd.js 3.78 kB
devtools/dist/devtools.js 259 B
devtools/dist/devtools.module.js 274 B
devtools/dist/devtools.umd.js 345 B
dist/preact.js 4.72 kB
dist/preact.min.js 4.75 kB
dist/preact.min.module.js 4.75 kB
dist/preact.min.umd.js 4.77 kB
dist/preact.module.js 4.74 kB
dist/preact.umd.js 4.79 kB
hooks/dist/hooks.js 1.53 kB
hooks/dist/hooks.module.js 1.56 kB
hooks/dist/hooks.umd.js 1.6 kB
jsx-runtime/dist/jsxRuntime.js 981 B
jsx-runtime/dist/jsxRuntime.module.js 956 B
jsx-runtime/dist/jsxRuntime.umd.js 1.06 kB
test-utils/dist/testUtils.js 451 B
test-utils/dist/testUtils.module.js 456 B
test-utils/dist/testUtils.umd.js 536 B

compressed-size-action

@coveralls
Copy link

coveralls commented Jul 27, 2024

Coverage Status

coverage: 99.486%. remained the same
when pulling bd8ebf0 on general-performance-improvements
into 7dc5703 on main.

@JoviDeCroock JoviDeCroock force-pushed the general-performance-improvements branch 2 times, most recently from 5fdad94 to bd8ebf0 Compare July 31, 2024 16:28
@JoviDeCroock JoviDeCroock merged commit 6ee78d2 into main Jul 31, 2024
13 checks passed
@JoviDeCroock JoviDeCroock deleted the general-performance-improvements branch July 31, 2024 16:36
@JoviDeCroock JoviDeCroock mentioned this pull request Aug 12, 2024
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.

3 participants