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

Single text node hot path #4523

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Single text node hot path #4523

wants to merge 1 commit into from

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Oct 3, 2024

Supersedes #3939

Similar to 3939 we are seeing some operations take longer as rather than mutating the text-node we'll be swapping positions instead. The impact seems higher in skew based diff though so not sure whether the performance impact will be as high as in 3939.

The replace_1k difference is similar to #3939 (comment)

This could also be problematic with signals as text-updates won't automatically update afaik

Copy link

github-actions bot commented Oct 3, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: faster ✔ 0% - 1% (1.14ms - 13.02ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.05ms - +0.10ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -4% - +0% (-3.31ms - +0.25ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +1% (-0.44ms - +0.12ms)
    preact-local vs preact-main
  • replace1k: slower ❌ 6% - 10% (4.43ms - 7.14ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +5% (-0.03ms - +0.10ms)
    preact-local vs preact-main
  • todo: faster ✔ 5% - 8% (1.77ms - 2.70ms)
    preact-local vs preact-main
  • update10th1k: faster ✔ 2% - 7% (0.76ms - 2.36ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: faster ✔ 7% - 7% (1.75ms - 1.78ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • hydrate1k: faster ✔ 5% - 8% (0.82ms - 1.23ms)
    preact-local vs preact-main
  • many-updates: faster ✔ 34% - 35% (1.58ms - 1.61ms)
    preact-local vs preact-main
  • replace1k: faster ✔ 3% - 5% (0.11ms - 0.16ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +1% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • update10th1k: faster ✔ 4% - 5% (0.15ms - 0.17ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local957.55ms - 964.40ms-faster ✔
0% - 1%
1.14ms - 13.02ms
preact-main963.20ms - 972.90msslower ❌
0% - 1%
1.14ms - 13.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local23.61ms - 23.63ms-faster ✔
7% - 7%
1.75ms - 1.78ms
preact-main25.37ms - 25.40msslower ❌
7% - 8%
1.75ms - 1.78ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.54ms - 16.68ms-unsure 🔍
-0% - +1%
-0.05ms - +0.10ms
preact-main16.55ms - 16.61msunsure 🔍
-1% - +0%
-0.10ms - +0.05ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.67ms - 1.70ms-unsure 🔍
-1% - +1%
-0.01ms - +0.02ms
preact-main1.66ms - 1.69msunsure 🔍
-1% - +1%
-0.02ms - +0.01ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local74.93ms - 78.39ms-unsure 🔍
-4% - +0%
-3.31ms - +0.25ms
preact-main77.76ms - 78.63msunsure 🔍
-0% - +4%
-0.25ms - +3.31ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local14.45ms - 14.76ms-faster ✔
5% - 8%
0.82ms - 1.23ms
preact-main15.50ms - 15.77msslower ❌
6% - 9%
0.82ms - 1.23ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.54ms - 16.59ms-unsure 🔍
-3% - +1%
-0.44ms - +0.12ms
preact-main16.45ms - 17.00msunsure 🔍
-1% - +3%
-0.12ms - +0.44ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.99ms - 3.01ms-faster ✔
34% - 35%
1.58ms - 1.61ms
preact-main4.58ms - 4.60msslower ❌
53% - 54%
1.58ms - 1.61ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local78.91ms - 81.32ms-slower ❌
6% - 10%
4.43ms - 7.14ms
preact-main73.71ms - 74.95msfaster ✔
6% - 9%
4.43ms - 7.14ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.44ms - 3.50ms-faster ✔
3% - 5%
0.11ms - 0.16ms
preact-main3.60ms - 3.61msslower ❌
3% - 5%
0.11ms - 0.16ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local30.64ms - 31.81ms-unsure 🔍
-4% - +0%
-1.20ms - +0.15ms
preact-main31.42ms - 32.09msunsure 🔍
-0% - +4%
-0.15ms - +1.20ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local35.39ms - 36.50ms-faster ✔
3% - 8%
1.14ms - 3.07ms
preact-main37.26ms - 38.85msslower ❌
3% - 9%
1.14ms - 3.07ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local28.64ms - 29.21ms-slower ❌
6% - 9%
1.63ms - 2.30ms
preact-main26.78ms - 27.14msfaster ✔
6% - 8%
1.63ms - 2.30ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local32.31ms - 33.98ms-slower ❌
16% - 24%
4.39ms - 6.49ms
preact-main27.07ms - 28.35msfaster ✔
14% - 19%
4.39ms - 6.49ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local20.86ms - 21.27ms-faster ✔
2% - 6%
0.33ms - 1.22ms
preact-main21.45ms - 22.24msslower ❌
2% - 6%
0.33ms - 1.22ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local22.55ms - 23.36ms-unsure 🔍
-4% - +0%
-0.91ms - +0.06ms
preact-main23.10ms - 23.65msunsure 🔍
-0% - +4%
-0.06ms - +0.91ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.96ms - 2.05ms-unsure 🔍
-2% - +5%
-0.03ms - +0.10ms
preact-main1.92ms - 2.02msunsure 🔍
-5% - +2%
-0.10ms - +0.03ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.82ms - 32.71ms-faster ✔
5% - 8%
1.77ms - 2.70ms
preact-main34.37ms - 34.63msslower ❌
5% - 8%
1.77ms - 2.70ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.23ms - 1.25ms-unsure 🔍
-1% - +1%
-0.01ms - +0.02ms
preact-main1.23ms - 1.25msunsure 🔍
-1% - +1%
-0.02ms - +0.01ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local32.56ms - 33.73ms-faster ✔
2% - 7%
0.76ms - 2.36ms
preact-main34.16ms - 35.24msslower ❌
2% - 7%
0.76ms - 2.36ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.38ms - 3.39ms-faster ✔
4% - 5%
0.15ms - 0.17ms
preact-main3.54ms - 3.55msslower ❌
4% - 5%
0.15ms - 0.17ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link

github-actions bot commented Oct 3, 2024

Size Change: +370 B (+0.6%)

Total Size: 62.4 kB

Filename Size Change
dist/preact.js 4.72 kB +64 B (+1.37%)
dist/preact.min.js 4.75 kB +61 B (+1.3%)
dist/preact.min.module.js 4.75 kB +63 B (+1.34%)
dist/preact.min.umd.js 4.77 kB +61 B (+1.3%)
dist/preact.module.js 4.74 kB +60 B (+1.28%)
dist/preact.umd.js 4.79 kB +61 B (+1.29%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 4.11 kB
compat/dist/compat.module.js 4.04 kB
compat/dist/compat.umd.js 4.18 kB
debug/dist/debug.js 3.82 kB
debug/dist/debug.module.js 3.83 kB
debug/dist/debug.umd.js 3.9 kB
devtools/dist/devtools.js 260 B
devtools/dist/devtools.module.js 274 B
devtools/dist/devtools.umd.js 346 B
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

@JoviDeCroock JoviDeCroock changed the title Revive 3939 Single text node hot path Oct 3, 2024
@coveralls
Copy link

coveralls commented Oct 3, 2024

Coverage Status

coverage: 99.492% (+0.004%) from 99.488%
when pulling 428ac57 on revive-3939
into 6a66daa on main.

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