Golf down hooks impl by JoviDeCroock · Pull Request #4897 · preactjs/preact (original) (raw)

@JoviDeCroock

@JoviDeCroock

JoviDeCroock

}
return hookState._nextValue |
return hookState._value;

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

📊 Tachometer Benchmark Results

Summary

duration

usedJSHeapSize

Results

create10k

duration

Version Avg time vs preact-local vs preact-main
preact-local 978.97ms - 983.11ms - faster ✔0% - 1%0.61ms - 6.56ms
preact-main 982.49ms - 986.77ms slower ❌0% - 1%0.61ms - 6.56ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 19.03ms - 19.05ms - unsure 🔍-0% - +0%-0.01ms - +0.02ms
preact-main 19.03ms - 19.04ms unsure 🔍-0% - +0%-0.02ms - +0.01ms -

filter-list

duration

Version Avg time vs preact-local vs preact-main
preact-local 16.55ms - 16.59ms - unsure 🔍-0% - +0%-0.03ms - +0.03ms
preact-main 16.55ms - 16.59ms unsure 🔍-0% - +0%-0.03ms - +0.03ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 1.53ms - 1.55ms - unsure 🔍-0% - +1%-0.00ms - +0.01ms
preact-main 1.53ms - 1.54ms unsure 🔍-1% - +0%-0.01ms - +0.00ms -

hydrate1k

duration

Version Avg time vs preact-local vs preact-main
preact-local 70.35ms - 72.26ms - unsure 🔍-0% - +4%-0.09ms - +2.68ms
preact-main 69.01ms - 71.01ms unsure 🔍-4% - +0%-2.68ms - +0.09ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 6.14ms - 6.72ms - unsure 🔍-8% - +5%-0.51ms - +0.35ms
preact-main 6.20ms - 6.82ms unsure 🔍-5% - +8%-0.35ms - +0.51ms -

many-updates

duration

Version Avg time vs preact-local vs preact-main
preact-local 16.21ms - 16.65ms - unsure 🔍-0% - +5%-0.07ms - +0.73ms
preact-main 15.77ms - 16.43ms unsure 🔍-4% - +0%-0.73ms - +0.07ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 3.72ms - 3.73ms - unsure 🔍-0% - +0%-0.00ms - +0.01ms
preact-main 3.72ms - 3.72ms unsure 🔍-0% - +0%-0.01ms - +0.00ms -

replace1k

duration

Version Avg time vs preact-local vs preact-main
preact-local 62.65ms - 64.05ms - unsure 🔍-3% - +0%-1.72ms - +0.30ms
preact-main 63.34ms - 64.79ms unsure 🔍-0% - +3%-0.30ms - +1.72ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 2.99ms - 3.01ms - unsure 🔍-0% - +1%-0.01ms - +0.02ms
preact-main 2.98ms - 3.00ms unsure 🔍-1% - +0%-0.02ms - +0.01ms -

run-warmup-0

Version Avg time vs preact-local vs preact-main
preact-local 25.02ms - 25.83ms - unsure 🔍-0% - +4%-0.11ms - +0.93ms
preact-main 24.69ms - 25.34ms unsure 🔍-4% - +0%-0.93ms - +0.11ms -

run-warmup-1

Version Avg time vs preact-local vs preact-main
preact-local 32.30ms - 33.11ms - unsure 🔍-3% - +0%-1.12ms - +0.05ms
preact-main 32.82ms - 33.66ms unsure 🔍-0% - +3%-0.05ms - +1.12ms -

run-warmup-2

Version Avg time vs preact-local vs preact-main
preact-local 32.85ms - 33.55ms - unsure 🔍-1% - +2%-0.49ms - +0.54ms
preact-main 32.80ms - 33.55ms unsure 🔍-2% - +1%-0.54ms - +0.49ms -

run-warmup-3

Version Avg time vs preact-local vs preact-main
preact-local 26.06ms - 26.87ms - unsure 🔍-1% - +3%-0.27ms - +0.76ms
preact-main 25.90ms - 26.54ms unsure 🔍-3% - +1%-0.76ms - +0.27ms -

run-warmup-4

Version Avg time vs preact-local vs preact-main
preact-local 24.14ms - 25.20ms - unsure 🔍-4% - +2%-0.96ms - +0.55ms
preact-main 24.34ms - 25.41ms unsure 🔍-2% - +4%-0.55ms - +0.96ms -

run-final

Version Avg time vs preact-local vs preact-main
preact-local 21.48ms - 22.32ms - faster ✔1% - 7%0.17ms - 1.50ms
preact-main 22.22ms - 23.26ms slower ❌1% - 7%0.17ms - 1.50ms -

text-update

duration

Version Avg time vs preact-local vs preact-main
preact-local 1.80ms - 1.87ms - unsure 🔍-6% - +0%-0.12ms - +0.01ms
preact-main 1.84ms - 1.94ms unsure 🔍-0% - +7%-0.01ms - +0.12ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 0.99ms - 1.02ms - unsure 🔍-2% - +2%-0.02ms - +0.02ms
preact-main 0.99ms - 1.01ms unsure 🔍-2% - +2%-0.02ms - +0.02ms -

todo

duration

Version Avg time vs preact-local vs preact-main
preact-local 31.00ms - 31.24ms - unsure 🔍-1% - +0%-0.18ms - +0.15ms
preact-main 31.02ms - 31.26ms unsure 🔍-0% - +1%-0.15ms - +0.18ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 1.25ms - 1.25ms - unsure 🔍-0% - +0%-0.00ms - +0.00ms
preact-main 1.25ms - 1.25ms unsure 🔍-0% - +0%-0.00ms - +0.00ms -

update10th1k

duration

Version Avg time vs preact-local vs preact-main
preact-local 31.05ms - 32.43ms - unsure 🔍-2% - +4%-0.54ms - +1.30ms
preact-main 30.76ms - 31.96ms unsure 🔍-4% - +2%-1.30ms - +0.54ms -

usedJSHeapSize

Version Avg time vs preact-local vs preact-main
preact-local 2.93ms - 2.94ms - unsure 🔍-0% - +0%-0.00ms - +0.01ms
preact-main 2.92ms - 2.93ms unsure 🔍-0% - +0%-0.01ms - +0.00ms -

tachometer-reporter-action v2 for CI

JoviDeCroock

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

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

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

Coverage Status

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

rschristian

Choose a reason for hiding this comment

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

Nice diff!

@JoviDeCroock

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})