Skip to content

Golf down hooks impl#4897

Merged
JoviDeCroock merged 2 commits intomainfrom
golf-down-hooks
Aug 24, 2025
Merged

Golf down hooks impl#4897
JoviDeCroock merged 2 commits intomainfrom
golf-down-hooks

Conversation

@JoviDeCroock
Copy link
Member

No description provided.

}

return hookState._nextValue || hookState._value;
return hookState._value;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already converting _nextValue to _value in the _render hook

@github-actions
Copy link

github-actions bot commented Aug 22, 2025

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: faster ✔ 0% - 1% (0.61ms - 6.56ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.03ms - +0.03ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +4% (-0.09ms - +2.68ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +5% (-0.07ms - +0.73ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -3% - +0% (-1.72ms - +0.30ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -6% - +0% (-0.12ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +0% (-0.18ms - +0.15ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -2% - +4% (-0.54ms - +1.30ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -8% - +5% (-0.51ms - +0.35ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +1% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +2% (-0.02ms - +0.02ms)
    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.01ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local978.97ms - 983.11ms-faster ✔
0% - 1%
0.61ms - 6.56ms
preact-main982.49ms - 986.77msslower ❌
0% - 1%
0.61ms - 6.56ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.03ms - 19.05ms-unsure 🔍
-0% - +0%
-0.01ms - +0.02ms
preact-main19.03ms - 19.04msunsure 🔍
-0% - +0%
-0.02ms - +0.01ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.55ms - 16.59ms-unsure 🔍
-0% - +0%
-0.03ms - +0.03ms
preact-main16.55ms - 16.59msunsure 🔍
-0% - +0%
-0.03ms - +0.03ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.53ms - 1.55ms-unsure 🔍
-0% - +1%
-0.00ms - +0.01ms
preact-main1.53ms - 1.54msunsure 🔍
-1% - +0%
-0.01ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local70.35ms - 72.26ms-unsure 🔍
-0% - +4%
-0.09ms - +2.68ms
preact-main69.01ms - 71.01msunsure 🔍
-4% - +0%
-2.68ms - +0.09ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local6.14ms - 6.72ms-unsure 🔍
-8% - +5%
-0.51ms - +0.35ms
preact-main6.20ms - 6.82msunsure 🔍
-5% - +8%
-0.35ms - +0.51ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.21ms - 16.65ms-unsure 🔍
-0% - +5%
-0.07ms - +0.73ms
preact-main15.77ms - 16.43msunsure 🔍
-4% - +0%
-0.73ms - +0.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.72ms - 3.73ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main3.72ms - 3.72msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5104
  • Commit: 69dfca2

duration

VersionAvg timevs preact-localvs preact-main
preact-local62.65ms - 64.05ms-unsure 🔍
-3% - +0%
-1.72ms - +0.30ms
preact-main63.34ms - 64.79msunsure 🔍
-0% - +3%
-0.30ms - +1.72ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.99ms - 3.01ms-unsure 🔍
-0% - +1%
-0.01ms - +0.02ms
preact-main2.98ms - 3.00msunsure 🔍
-1% - +0%
-0.02ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local25.02ms - 25.83ms-unsure 🔍
-0% - +4%
-0.11ms - +0.93ms
preact-main24.69ms - 25.34msunsure 🔍
-4% - +0%
-0.93ms - +0.11ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local32.30ms - 33.11ms-unsure 🔍
-3% - +0%
-1.12ms - +0.05ms
preact-main32.82ms - 33.66msunsure 🔍
-0% - +3%
-0.05ms - +1.12ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local32.85ms - 33.55ms-unsure 🔍
-1% - +2%
-0.49ms - +0.54ms
preact-main32.80ms - 33.55msunsure 🔍
-2% - +1%
-0.54ms - +0.49ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local26.06ms - 26.87ms-unsure 🔍
-1% - +3%
-0.27ms - +0.76ms
preact-main25.90ms - 26.54msunsure 🔍
-3% - +1%
-0.76ms - +0.27ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local24.14ms - 25.20ms-unsure 🔍
-4% - +2%
-0.96ms - +0.55ms
preact-main24.34ms - 25.41msunsure 🔍
-2% - +4%
-0.55ms - +0.96ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local21.48ms - 22.32ms-faster ✔
1% - 7%
0.17ms - 1.50ms
preact-main22.22ms - 23.26msslower ❌
1% - 7%
0.17ms - 1.50ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 250
  • Built by: CI #5104
  • Commit: 69dfca2

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.80ms - 1.87ms-unsure 🔍
-6% - +0%
-0.12ms - +0.01ms
preact-main1.84ms - 1.94msunsure 🔍
-0% - +7%
-0.01ms - +0.12ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.99ms - 1.02ms-unsure 🔍
-2% - +2%
-0.02ms - +0.02ms
preact-main0.99ms - 1.01msunsure 🔍
-2% - +2%
-0.02ms - +0.02ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.00ms - 31.24ms-unsure 🔍
-1% - +0%
-0.18ms - +0.15ms
preact-main31.02ms - 31.26msunsure 🔍
-0% - +1%
-0.15ms - +0.18ms
-

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-local31.05ms - 32.43ms-unsure 🔍
-2% - +4%
-0.54ms - +1.30ms
preact-main30.76ms - 31.96msunsure 🔍
-4% - +2%
-1.30ms - +0.54ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.93ms - 2.94ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main2.92ms - 2.93msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

tachometer-reporter-action v2 for CI

if (allHooksEmpty) {
return prevScu ? prevScu.call(this, p, s, c) : true;
}
const hooksList = hookState._component.__hooks._list;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than doing excessive checks we just merge these paths

@github-actions
Copy link

github-actions bot commented Aug 22, 2025

Size Change: -73 B (-0.15%)

Total Size: 47.3 kB

Filename Size Change
hooks/dist/hooks.js 1.53 kB -24 B (-1.55%)
hooks/dist/hooks.mjs 1.56 kB -26 B (-1.64%)
hooks/dist/hooks.umd.js 1.6 kB -23 B (-1.42%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 3.9 kB
compat/dist/compat.mjs 3.82 kB
compat/dist/compat.umd.js 3.95 kB
debug/dist/debug.js 3.9 kB
debug/dist/debug.mjs 3.9 kB
debug/dist/debug.umd.js 3.98 kB
devtools/dist/devtools.js 263 B
devtools/dist/devtools.mjs 273 B
devtools/dist/devtools.umd.js 348 B
dist/preact.js 4.67 kB
dist/preact.mjs 4.69 kB
dist/preact.umd.js 4.75 kB
jsx-runtime/dist/jsxRuntime.js 892 B
jsx-runtime/dist/jsxRuntime.mjs 861 B
jsx-runtime/dist/jsxRuntime.umd.js 966 B
test-utils/dist/testUtils.js 473 B
test-utils/dist/testUtils.mjs 473 B
test-utils/dist/testUtils.umd.js 555 B

compressed-size-action

@coveralls
Copy link

coveralls commented Aug 22, 2025

Coverage Status

coverage: 99.535% (-0.001%) from 99.536%
when pulling 69dfca2 on golf-down-hooks
into 025875a on main.

Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice diff!

@JoviDeCroock JoviDeCroock merged commit f23272c into main Aug 24, 2025
13 checks passed
@JoviDeCroock JoviDeCroock deleted the golf-down-hooks branch August 24, 2025 07:16
@JoviDeCroock JoviDeCroock mentioned this pull request Feb 1, 2026
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