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

refactor: Switch to Object.is for hook args #4663

Merged
merged 4 commits into from
Feb 14, 2025
Merged

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Feb 13, 2025

Supercedes #3954

Thought of this earlier, the v11 list reminded me.

Copy link

github-actions bot commented Feb 13, 2025

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-7.24ms - +1.42ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.15ms - +0.15ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +1% (-0.91ms - +0.94ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -2% - +0% (-0.34ms - +0.07ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.66ms - +0.56ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -4% - +5% (-0.09ms - +0.10ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -3% - +2% (-1.10ms - +0.56ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -3% - +4% (-0.84ms - +1.29ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -2% - +2% (-0.03ms - +0.03ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -5% - +5% (-0.47ms - +0.48ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.02ms - +0.02ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +1% (-0.00ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • todo: faster ✔ 0% - 2% (0.00ms - 0.03ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -1% - +1% (-0.04ms - +0.02ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local939.29ms - 944.61ms-unsure 🔍
-1% - +0%
-7.24ms - +1.42ms
preact-main941.45ms - 948.28msunsure 🔍
-0% - +1%
-1.42ms - +7.24ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.19ms - 19.20ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
preact-main19.19ms - 19.20msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.52ms - 16.78ms-unsure 🔍
-1% - +1%
-0.15ms - +0.15ms
preact-main16.57ms - 16.73msunsure 🔍
-1% - +1%
-0.15ms - +0.15ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.52ms - 1.56ms-unsure 🔍
-2% - +2%
-0.03ms - +0.03ms
preact-main1.52ms - 1.56msunsure 🔍
-2% - +2%
-0.03ms - +0.03ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local73.22ms - 74.59ms-unsure 🔍
-1% - +1%
-0.91ms - +0.94ms
preact-main73.26ms - 74.52msunsure 🔍
-1% - +1%
-0.94ms - +0.91ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local9.44ms - 10.08ms-unsure 🔍
-5% - +5%
-0.47ms - +0.48ms
preact-main9.41ms - 10.11msunsure 🔍
-5% - +5%
-0.48ms - +0.47ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.16ms - 16.53ms-unsure 🔍
-2% - +0%
-0.34ms - +0.07ms
preact-main16.39ms - 16.57msunsure 🔍
-0% - +2%
-0.07ms - +0.34ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.75ms - 3.77ms-unsure 🔍
-0% - +0%
-0.02ms - +0.02ms
preact-main3.75ms - 3.77msunsure 🔍
-0% - +0%
-0.02ms - +0.02ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #4370
  • Commit: ff0c695

duration

VersionAvg timevs preact-localvs preact-main
preact-local64.95ms - 65.61ms-unsure 🔍
-1% - +1%
-0.66ms - +0.56ms
preact-main64.81ms - 65.84msunsure 🔍
-1% - +1%
-0.56ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.96ms - 2.98ms-unsure 🔍
-0% - +1%
-0.00ms - +0.02ms
preact-main2.96ms - 2.97msunsure 🔍
-1% - +0%
-0.02ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local29.40ms - 29.94ms-unsure 🔍
-2% - +1%
-0.57ms - +0.15ms
preact-main29.63ms - 30.12msunsure 🔍
-1% - +2%
-0.15ms - +0.57ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local33.30ms - 34.09ms-unsure 🔍
-1% - +2%
-0.34ms - +0.76ms
preact-main33.09ms - 33.87msunsure 🔍
-2% - +1%
-0.76ms - +0.34ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local25.15ms - 25.49ms-unsure 🔍
-1% - +1%
-0.33ms - +0.21ms
preact-main25.18ms - 25.58msunsure 🔍
-1% - +1%
-0.21ms - +0.33ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local24.12ms - 25.22ms-unsure 🔍
-5% - +2%
-1.16ms - +0.42ms
preact-main24.48ms - 25.60msunsure 🔍
-2% - +5%
-0.42ms - +1.16ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local24.24ms - 25.42ms-unsure 🔍
-1% - +5%
-0.30ms - +1.25ms
preact-main23.85ms - 24.86msunsure 🔍
-5% - +1%
-1.25ms - +0.30ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local19.94ms - 20.32ms-unsure 🔍
-1% - +2%
-0.11ms - +0.42ms
preact-main19.79ms - 20.16msunsure 🔍
-2% - +1%
-0.42ms - +0.11ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.07ms - 2.20ms-unsure 🔍
-4% - +5%
-0.09ms - +0.10ms
preact-main2.06ms - 2.21msunsure 🔍
-5% - +4%
-0.10ms - +0.09ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.11ms - 1.11ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main1.11ms - 1.11msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local34.41ms - 35.59ms-unsure 🔍
-3% - +2%
-1.10ms - +0.56ms
preact-main34.69ms - 35.86msunsure 🔍
-2% - +3%
-0.56ms - +1.10ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.21ms - 1.22ms-faster ✔
0% - 2%
0.00ms - 0.03ms
preact-main1.22ms - 1.24msslower ❌
0% - 2%
0.00ms - 0.03ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local32.32ms - 33.87ms-unsure 🔍
-3% - +4%
-0.84ms - +1.29ms
preact-main32.14ms - 33.60msunsure 🔍
-4% - +3%
-1.29ms - +0.84ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.92ms - 2.95ms-unsure 🔍
-1% - +1%
-0.04ms - +0.02ms
preact-main2.93ms - 2.97msunsure 🔍
-1% - +1%
-0.02ms - +0.04ms
-

tachometer-reporter-action v2 for CI

Copy link

github-actions bot commented Feb 13, 2025

Size Change: +37 B (+0.06%)

Total Size: 60.4 kB

Filename Size Change
hooks/dist/hooks.js 1.55 kB +13 B (+0.85%)
hooks/dist/hooks.module.js 1.58 kB +13 B (+0.83%)
hooks/dist/hooks.umd.js 1.62 kB +11 B (+0.68%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 3.67 kB
compat/dist/compat.module.js 3.59 kB
compat/dist/compat.umd.js 3.73 kB
debug/dist/debug.js 3.87 kB
debug/dist/debug.module.js 3.87 kB
debug/dist/debug.umd.js 3.95 kB
devtools/dist/devtools.js 260 B
devtools/dist/devtools.module.js 274 B
devtools/dist/devtools.umd.js 346 B
dist/preact.js 4.56 kB
dist/preact.min.js 4.6 kB
dist/preact.min.module.js 4.59 kB
dist/preact.min.umd.js 4.63 kB
dist/preact.module.js 4.59 kB
dist/preact.umd.js 4.65 kB
jsx-runtime/dist/jsxRuntime.js 957 B
jsx-runtime/dist/jsxRuntime.module.js 926 B
jsx-runtime/dist/jsxRuntime.umd.js 1.03 kB
test-utils/dist/testUtils.js 473 B
test-utils/dist/testUtils.module.js 477 B
test-utils/dist/testUtils.umd.js 555 B

compressed-size-action

hooks/src/index.js Outdated Show resolved Hide resolved
@rschristian
Copy link
Member Author

rschristian commented Feb 13, 2025

So coveralls is dying for different reasons now. Yippee

https://status.coveralls.io/

@rschristian rschristian merged commit 5094a51 into v11-2 Feb 14, 2025
12 checks passed
@rschristian rschristian deleted the refactor/object-is branch February 14, 2025 06:07
JoviDeCroock added a commit that referenced this pull request Feb 18, 2025
* Remove unused imports

* refactor: Switch to Object.is for hook args

* refactor: Copy to `useReducer` & store `Object` accessor

* test: Add tests for `useEffect` & `useState` w/ `NaN`

Co-authored-by: jayrobin <james.michael.robinson@googlemail.com>

---------

Co-authored-by: jdecroock <decroockjovi@gmail.com>
Co-authored-by: jayrobin <james.michael.robinson@googlemail.com>
JoviDeCroock added a commit that referenced this pull request Feb 19, 2025
* Remove unused imports

* refactor: Switch to Object.is for hook args

* refactor: Copy to `useReducer` & store `Object` accessor

* test: Add tests for `useEffect` & `useState` w/ `NaN`

Co-authored-by: jayrobin <james.michael.robinson@googlemail.com>

---------

Co-authored-by: jdecroock <decroockjovi@gmail.com>
Co-authored-by: jayrobin <james.michael.robinson@googlemail.com>
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.

2 participants