preact icon indicating copy to clipboard operation
preact copied to clipboard

Add a fix for context unmounting, from experimenting with our application

Open jpnelson opened this issue 1 year ago • 1 comments

In testing for our application, this ended up being a fair bit faster than how it was during client routing transitions (that is, when unmounting lots of context subscribers)

I don't know if we need a benchmark specifically for having many context subscribers unmount, but that would be the use case that we ran into with this one.

jpnelson avatar Apr 22 '23 17:04 jpnelson

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: faster ✔ 0% - 6% (0.15ms - 7.15ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -5% - +1% (-2.28ms - +0.46ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -1% - +0% (-6.81ms - +4.22ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -2% - +1% (-0.38ms - +0.26ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -2% - +3% (-2.05ms - +3.26ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -3% - +3% (-0.90ms - +0.98ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -1% - +4% (-0.03ms - +0.11ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -4% - +2% (-2.91ms - +1.40ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -1% - +0% (-0.02ms - +0.01ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.03ms - +0.03ms)
    preact-local vs preact-master
  • filter_list: faster ✔ 0% - 1% (0.00ms - 0.01ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -1% - +0% (-0.06ms - +0.03ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -1% - +0% (-0.03ms - +0.02ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -0% - +3% (-0.00ms - +0.02ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -1% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 70
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master117.60ms - 122.98ms-slower ❌
0% - 6%
0.15ms - 7.15ms
unsure 🔍
-4% - +2%
-4.97ms - +3.02ms
preact-local114.40ms - 118.87msfaster ✔
0% - 6%
0.15ms - 7.15ms
-faster ✔
1% - 7%
0.93ms - 8.33ms
preact-hooks118.32ms - 124.21msunsure 🔍
-3% - +4%
-3.02ms - +4.97ms
slower ❌
1% - 7%
0.93ms - 8.33ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.37ms - 3.40ms-unsure 🔍
-0% - +1%
-0.01ms - +0.02ms
unsure 🔍
-1% - +0%
-0.03ms - +0.00ms
preact-local3.36ms - 3.38msunsure 🔍
-1% - +0%
-0.02ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.03ms
preact-hooks3.39ms - 3.40msunsure 🔍
-0% - +1%
-0.00ms - +0.03ms
slower ❌
0% - 1%
0.01ms - 0.03ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master42.33ms - 44.34ms-unsure 🔍
-6% - +2%
-2.49ms - +0.90ms
unsure 🔍
-5% - +1%
-2.44ms - +0.34ms
preact-local42.76ms - 45.49msunsure 🔍
-2% - +6%
-0.90ms - +2.49ms
-unsure 🔍
-4% - +3%
-1.93ms - +1.41ms
preact-hooks43.42ms - 45.34msunsure 🔍
-1% - +6%
-0.34ms - +2.44ms
unsure 🔍
-3% - +4%
-1.41ms - +1.93ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master59.01ms - 62.11ms-unsure 🔍
-3% - +4%
-1.71ms - +2.33ms
unsure 🔍
-5% - +1%
-3.22ms - +0.65ms
preact-local58.95ms - 61.56msunsure 🔍
-4% - +3%
-2.33ms - +1.71ms
-unsure 🔍
-5% - +0%
-3.34ms - +0.16ms
preact-hooks60.68ms - 63.01msunsure 🔍
-1% - +5%
-0.65ms - +3.22ms
unsure 🔍
-0% - +6%
-0.16ms - +3.34ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master39.31ms - 43.61ms-unsure 🔍
-5% - +9%
-2.15ms - +3.70ms
unsure 🔍
-6% - +7%
-2.61ms - +3.07ms
preact-local38.70ms - 42.67msunsure 🔍
-9% - +5%
-3.70ms - +2.15ms
-unsure 🔍
-8% - +5%
-3.26ms - +2.17ms
preact-hooks39.38ms - 43.09msunsure 🔍
-7% - +6%
-3.07ms - +2.61ms
unsure 🔍
-5% - +8%
-2.17ms - +3.26ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master49.40ms - 53.24ms-unsure 🔍
-7% - +4%
-3.63ms - +2.11ms
faster ✔
1% - 11%
0.66ms - 6.15ms
preact-local49.95ms - 54.22msunsure 🔍
-4% - +7%
-2.11ms - +3.63ms
-unsure 🔍
-10% - +0%
-5.54ms - +0.26ms
preact-hooks52.77ms - 56.68msslower ❌
1% - 12%
0.66ms - 6.15ms
unsure 🔍
-1% - +11%
-0.26ms - +5.54ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master49.59ms - 52.52ms-unsure 🔍
-5% - +3%
-2.48ms - +1.74ms
unsure 🔍
-6% - +4%
-3.05ms - +2.01ms
preact-local49.91ms - 52.95msunsure 🔍
-3% - +5%
-1.74ms - +2.48ms
-unsure 🔍
-5% - +5%
-2.71ms - +2.41ms
preact-hooks49.52ms - 53.64msunsure 🔍
-4% - +6%
-2.01ms - +3.05ms
unsure 🔍
-5% - +5%
-2.41ms - +2.71ms
-

run-final

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master32.59ms - 36.58ms-unsure 🔍
-1% - +15%
-0.17ms - +4.86ms
unsure 🔍
-13% - +3%
-4.98ms - +1.04ms
preact-local30.71ms - 33.77msunsure 🔍
-14% - +0%
-4.86ms - +0.17ms
-faster ✔
5% - 19%
1.58ms - 7.03ms
preact-hooks34.30ms - 38.80msunsure 🔍
-3% - +15%
-1.04ms - +4.98ms
slower ❌
5% - 22%
1.58ms - 7.03ms
-
03_update10th1k_x16
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 100
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master45.74ms - 47.71ms-unsure 🔍
-1% - +5%
-0.46ms - +2.28ms
unsure 🔍
-1% - +5%
-0.62ms - +2.10ms
preact-local44.86ms - 46.76msunsure 🔍
-5% - +1%
-2.28ms - +0.46ms
-unsure 🔍
-3% - +3%
-1.51ms - +1.16ms
preact-hooks45.05ms - 46.93msunsure 🔍
-4% - +1%
-2.10ms - +0.62ms
unsure 🔍
-3% - +3%
-1.16ms - +1.51ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.30ms - 3.30ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
0% - 1%
0.01ms - 0.02ms
preact-local3.30ms - 3.30msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
0% - 1%
0.02ms - 0.02ms
preact-hooks3.32ms - 3.32msslower ❌
0% - 1%
0.01ms - 0.02ms
slower ❌
0% - 1%
0.02ms - 0.02ms
-
07_create10k
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 50
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1314.45ms - 1322.89ms-unsure 🔍
-0% - +1%
-4.22ms - +6.81ms
unsure 🔍
-1% - +0%
-9.19ms - +6.14ms
preact-local1313.82ms - 1320.93msunsure 🔍
-1% - +0%
-6.81ms - +4.22ms
-unsure 🔍
-1% - +0%
-10.14ms - +4.50ms
preact-hooks1313.80ms - 1326.59msunsure 🔍
-0% - +1%
-6.14ms - +9.19ms
unsure 🔍
-0% - +1%
-4.50ms - +10.14ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master25.39ms - 25.44ms-unsure 🔍
-0% - +0%
-0.03ms - +0.03ms
unsure 🔍
+0% - +0%
+0.01ms - +0.06ms
preact-local25.39ms - 25.44msunsure 🔍
-0% - +0%
-0.03ms - +0.03ms
-unsure 🔍
+0% - +0%
+0.01ms - +0.06ms
preact-hooks25.38ms - 25.38msunsure 🔍
-0% - -0%
-0.06ms - -0.01ms
unsure 🔍
-0% - -0%
-0.06ms - -0.01ms
-
filter_list
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 50
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master21.19ms - 21.61ms-unsure 🔍
-1% - +2%
-0.26ms - +0.38ms
unsure 🔍
-1% - +2%
-0.23ms - +0.37ms
preact-local21.10ms - 21.57msunsure 🔍
-2% - +1%
-0.38ms - +0.26ms
-unsure 🔍
-1% - +2%
-0.31ms - +0.33ms
preact-hooks21.11ms - 21.54msunsure 🔍
-2% - +1%
-0.37ms - +0.23ms
unsure 🔍
-2% - +1%
-0.33ms - +0.31ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.44ms - 1.45ms-slower ❌
0% - 1%
0.00ms - 0.01ms
faster ✔
1% - 1%
0.01ms - 0.02ms
preact-local1.44ms - 1.44msfaster ✔
0% - 1%
0.00ms - 0.01ms
-faster ✔
1% - 2%
0.02ms - 0.03ms
preact-hooks1.46ms - 1.46msslower ❌
1% - 1%
0.01ms - 0.02ms
slower ❌
1% - 2%
0.02ms - 0.03ms
-
hydrate1k
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 50
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master114.94ms - 118.64ms-unsure 🔍
-3% - +2%
-3.26ms - +2.05ms
unsure 🔍
-1% - +4%
-1.23ms - +4.02ms
preact-local115.49ms - 119.31msunsure 🔍
-2% - +3%
-2.05ms - +3.26ms
-unsure 🔍
-1% - +4%
-0.66ms - +4.67ms
preact-hooks113.53ms - 117.26msunsure 🔍
-3% - +1%
-4.02ms - +1.23ms
unsure 🔍
-4% - +1%
-4.67ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master5.99ms - 6.06ms-unsure 🔍
-0% - +1%
-0.03ms - +0.06ms
faster ✔
0% - 2%
0.02ms - 0.11ms
preact-local5.98ms - 6.04msunsure 🔍
-1% - +0%
-0.06ms - +0.03ms
-faster ✔
1% - 2%
0.04ms - 0.13ms
preact-hooks6.06ms - 6.12msslower ❌
0% - 2%
0.02ms - 0.11ms
slower ❌
1% - 2%
0.04ms - 0.13ms
-
many_updates
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 70
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master33.22ms - 34.54ms-unsure 🔍
-3% - +3%
-0.98ms - +0.90ms
unsure 🔍
-5% - +0%
-1.79ms - +0.02ms
preact-local33.26ms - 34.59msunsure 🔍
-3% - +3%
-0.90ms - +0.98ms
-unsure 🔍
-5% - +0%
-1.75ms - +0.07ms
preact-hooks34.15ms - 35.38msunsure 🔍
-0% - +5%
-0.02ms - +1.79ms
unsure 🔍
-0% - +5%
-0.07ms - +1.75ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master4.50ms - 4.54ms-unsure 🔍
-0% - +1%
-0.02ms - +0.03ms
unsure 🔍
-1% - +0%
-0.04ms - +0.01ms
preact-local4.50ms - 4.53msunsure 🔍
-1% - +0%
-0.03ms - +0.02ms
-unsure 🔍
-1% - +0%
-0.04ms - +0.01ms
preact-hooks4.51ms - 4.55msunsure 🔍
-0% - +1%
-0.01ms - +0.04ms
unsure 🔍
-0% - +1%
-0.01ms - +0.04ms
-
text_update
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 190
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.07ms - 3.18ms-unsure 🔍
-3% - +1%
-0.11ms - +0.03ms
faster ✔
3% - 7%
0.08ms - 0.23ms
preact-local3.11ms - 3.21msunsure 🔍
-1% - +4%
-0.03ms - +0.11ms
-faster ✔
2% - 6%
0.05ms - 0.19ms
preact-hooks3.23ms - 3.34msslower ❌
3% - 8%
0.08ms - 0.23ms
slower ❌
1% - 6%
0.05ms - 0.19ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.70ms - 0.71ms-unsure 🔍
-3% - +0%
-0.02ms - +0.00ms
slower ❌
3% - 5%
0.02ms - 0.03ms
preact-local0.71ms - 0.72msunsure 🔍
-0% - +3%
-0.00ms - +0.02ms
-slower ❌
4% - 6%
0.03ms - 0.04ms
preact-hooks0.68ms - 0.68msfaster ✔
2% - 4%
0.02ms - 0.03ms
faster ✔
4% - 6%
0.03ms - 0.04ms
-
todo
  • Browser: chrome-headless 112.0.5615.121
  • Sample size: 50
  • Built by: Benchmarks #1077
  • Commit: ef6790d

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master73.72ms - 77.56ms-unsure 🔍
-2% - +4%
-1.40ms - +2.91ms
unsure 🔍
-4% - +2%
-3.10ms - +1.54ms
preact-local73.90ms - 75.87msunsure 🔍
-4% - +2%
-2.91ms - +1.40ms
-unsure 🔍
-4% - +0%
-3.17ms - +0.10ms
preact-hooks75.12ms - 77.73msunsure 🔍
-2% - +4%
-1.54ms - +3.10ms
unsure 🔍
-0% - +4%
-0.10ms - +3.17ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.92ms - 0.93ms-unsure 🔍
-0% - +1%
-0.00ms - +0.01ms
faster ✔
2% - 3%
0.02ms - 0.03ms
preact-local0.92ms - 0.92msunsure 🔍
-1% - +0%
-0.01ms - +0.00ms
-faster ✔
3% - 3%
0.02ms - 0.03ms
preact-hooks0.95ms - 0.95msslower ❌
2% - 3%
0.02ms - 0.03ms
slower ❌
3% - 3%
0.02ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

github-actions[bot] avatar Apr 22 '23 17:04 github-actions[bot]