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

Only run unmounting loop if any children remain to unmont (+2 B) #4199

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

andrewiggins
Copy link
Member

@andrewiggins andrewiggins commented Nov 7, 2023

Since we are now looping through children 3 times, I'm hoping skipping a loop on update scenarios provides a small improvement

Copy link

github-actions bot commented Nov 7, 2023

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -3% - +2% (-3.26ms - +2.03ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -6% - +3% (-1.93ms - +0.86ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -1% - +0% (-12.29ms - +1.76ms)
    preact-local vs preact-main
  • filter_list: unsure 🔍 -0% - +1% (-0.05ms - +0.16ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -2% - +3% (-1.51ms - +3.01ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -1% - +4% (-0.51ms - +1.53ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -10% - +3% (-0.55ms - +0.20ms)
    preact-local vs preact-main
  • todo: faster ✔ 1% - 2% (0.17ms - 0.48ms)
    preact-local vs preact-main

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter_list: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -0% - +1% (-0.02ms - +0.04ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -2% - +5% (-0.01ms - +0.03ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main

Results

02_replace1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main108.29ms - 112.48ms-unsure 🔍
-2% - +3%
-2.03ms - +3.26ms
slower ❌
1% - 5%
0.79ms - 5.27ms
preact-local108.15ms - 111.39msunsure 🔍
-3% - +2%
-3.26ms - +2.03ms
-slower ❌
1% - 4%
0.61ms - 4.21ms
preact-hooks106.56ms - 108.15msfaster ✔
1% - 5%
0.79ms - 5.27ms
faster ✔
1% - 4%
0.61ms - 4.21ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.33ms - 3.34ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
faster ✔
0% - 1%
0.01ms - 0.02ms
preact-local3.33ms - 3.34msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.03ms
preact-hooks3.35ms - 3.36msslower ❌
0% - 1%
0.01ms - 0.02ms
slower ❌
0% - 1%
0.01ms - 0.03ms
-

run-warmup-0

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main50.65ms - 54.15ms-unsure 🔍
-3% - +5%
-1.62ms - +2.83ms
unsure 🔍
-6% - +2%
-3.38ms - +1.00ms
preact-local50.42ms - 53.18msunsure 🔍
-5% - +3%
-2.83ms - +1.62ms
-unsure 🔍
-7% - +0%
-3.71ms - +0.12ms
preact-hooks52.27ms - 54.92msunsure 🔍
-2% - +7%
-1.00ms - +3.38ms
unsure 🔍
-0% - +7%
-0.12ms - +3.71ms
-

run-warmup-1

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main57.48ms - 60.01ms-unsure 🔍
-2% - +4%
-1.15ms - +2.57ms
unsure 🔍
-6% - +0%
-3.51ms - +0.11ms
preact-local56.67ms - 59.40msunsure 🔍
-4% - +2%
-2.57ms - +1.15ms
-faster ✔
1% - 7%
0.53ms - 4.29ms
preact-hooks59.15ms - 61.74msunsure 🔍
-0% - +6%
-0.11ms - +3.51ms
slower ❌
1% - 7%
0.53ms - 4.29ms
-

run-warmup-2

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main37.00ms - 38.10ms-unsure 🔍
-3% - +1%
-1.23ms - +0.42ms
faster ✔
4% - 7%
1.41ms - 2.88ms
preact-local37.33ms - 38.57msunsure 🔍
-1% - +3%
-0.42ms - +1.23ms
-faster ✔
2% - 6%
0.95ms - 2.53ms
preact-hooks39.20ms - 40.19msslower ❌
4% - 8%
1.41ms - 2.88ms
slower ❌
2% - 7%
0.95ms - 2.53ms
-

run-warmup-3

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main31.37ms - 31.95ms-slower ❌
0% - 2%
0.08ms - 0.71ms
unsure 🔍
-0% - +2%
-0.15ms - +0.49ms
preact-local31.15ms - 31.38msfaster ✔
0% - 2%
0.08ms - 0.71ms
-faster ✔
0% - 1%
0.05ms - 0.40ms
preact-hooks31.35ms - 31.62msunsure 🔍
-2% - +0%
-0.49ms - +0.15ms
slower ❌
0% - 1%
0.05ms - 0.40ms
-

run-warmup-4

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main42.34ms - 45.26ms-unsure 🔍
-7% - +2%
-3.14ms - +1.13ms
faster ✔
12% - 19%
6.30ms - 9.95ms
preact-local43.24ms - 46.37msunsure 🔍
-3% - +7%
-1.13ms - +3.14ms
-faster ✔
10% - 17%
5.21ms - 9.03ms
preact-hooks50.83ms - 53.02msslower ❌
14% - 23%
6.30ms - 9.95ms
slower ❌
11% - 21%
5.21ms - 9.03ms
-

run-final

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main29.36ms - 32.55ms-unsure 🔍
-5% - +8%
-1.64ms - +2.33ms
unsure 🔍
-2% - +10%
-0.45ms - +2.86ms
preact-local29.43ms - 31.78msunsure 🔍
-7% - +5%
-2.33ms - +1.64ms
-unsure 🔍
-1% - +7%
-0.39ms - +2.11ms
preact-hooks29.31ms - 30.19msunsure 🔍
-9% - +1%
-2.86ms - +0.45ms
unsure 🔍
-7% - +1%
-2.11ms - +0.39ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main30.92ms - 32.91ms-unsure 🔍
-3% - +6%
-0.86ms - +1.93ms
unsure 🔍
-3% - +6%
-1.01ms - +1.74ms
preact-local30.41ms - 32.36msunsure 🔍
-6% - +3%
-1.93ms - +0.86ms
-unsure 🔍
-5% - +4%
-1.53ms - +1.20ms
preact-hooks30.60ms - 32.50msunsure 🔍
-5% - +3%
-1.74ms - +1.01ms
unsure 🔍
-4% - +5%
-1.20ms - +1.53ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.28ms - 3.28ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
faster ✔
0% - 1%
0.01ms - 0.02ms
preact-local3.28ms - 3.28msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.02ms
preact-hooks3.29ms - 3.30msslower ❌
0% - 1%
0.01ms - 0.02ms
slower ❌
0% - 1%
0.01ms - 0.02ms
-
07_create10k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main1147.28ms - 1158.62ms-unsure 🔍
-0% - +1%
-1.76ms - +12.29ms
unsure 🔍
-1% - +1%
-12.13ms - +5.80ms
preact-local1143.54ms - 1151.83msunsure 🔍
-1% - +0%
-12.29ms - +1.76ms
-faster ✔
0% - 1%
0.34ms - 16.52ms
preact-hooks1149.17ms - 1163.06msunsure 🔍
-1% - +1%
-5.80ms - +12.13ms
slower ❌
0% - 1%
0.34ms - 16.52ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.33ms - 26.33ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local26.33ms - 26.33msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks26.35ms - 26.35msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
filter_list

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main16.69ms - 16.84ms-unsure 🔍
-1% - +0%
-0.16ms - +0.05ms
unsure 🔍
-4% - +1%
-0.72ms - +0.13ms
preact-local16.74ms - 16.90msunsure 🔍
-0% - +1%
-0.05ms - +0.16ms
-unsure 🔍
-4% - +1%
-0.66ms - +0.18ms
preact-hooks16.65ms - 17.48msunsure 🔍
-1% - +4%
-0.13ms - +0.72ms
unsure 🔍
-1% - +4%
-0.18ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main1.35ms - 1.36ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
faster ✔
1% - 2%
0.02ms - 0.03ms
preact-local1.35ms - 1.35msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-faster ✔
1% - 3%
0.02ms - 0.04ms
preact-hooks1.37ms - 1.39msslower ❌
1% - 2%
0.02ms - 0.03ms
slower ❌
1% - 3%
0.02ms - 0.04ms
-
hydrate1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main84.74ms - 87.83ms-unsure 🔍
-3% - +2%
-3.01ms - +1.51ms
unsure 🔍
-1% - +3%
-1.08ms - +2.21ms
preact-local85.39ms - 88.69msunsure 🔍
-2% - +3%
-1.51ms - +3.01ms
-unsure 🔍
-1% - +4%
-0.43ms - +3.06ms
preact-hooks85.16ms - 86.29msunsure 🔍
-3% - +1%
-2.21ms - +1.08ms
unsure 🔍
-3% - +0%
-3.06ms - +0.43ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main6.12ms - 6.13ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
unsure 🔍
-0% - -0%
-0.03ms - -0.02ms
preact-local6.12ms - 6.13msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-unsure 🔍
-0% - -0%
-0.03ms - -0.02ms
preact-hooks6.15ms - 6.15msunsure 🔍
+0% - +0%
+0.02ms - +0.03ms
unsure 🔍
+0% - +0%
+0.02ms - +0.03ms
-
many_updates

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main36.48ms - 37.70ms-unsure 🔍
-4% - +1%
-1.53ms - +0.51ms
faster ✔
2% - 7%
0.65ms - 2.87ms
preact-local36.78ms - 38.42msunsure 🔍
-1% - +4%
-0.51ms - +1.53ms
-faster ✔
0% - 6%
0.01ms - 2.48ms
preact-hooks37.92ms - 39.77msslower ❌
2% - 8%
0.65ms - 2.87ms
unsure 🔍
-0% - +7%
+0.01ms - +2.48ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main4.52ms - 4.56ms-unsure 🔍
-1% - +0%
-0.04ms - +0.02ms
unsure 🔍
-1% - +0%
-0.03ms - +0.02ms
preact-local4.53ms - 4.57msunsure 🔍
-0% - +1%
-0.02ms - +0.04ms
-unsure 🔍
-0% - +1%
-0.02ms - +0.03ms
preact-hooks4.53ms - 4.56msunsure 🔍
-0% - +1%
-0.02ms - +0.03ms
unsure 🔍
-1% - +0%
-0.03ms - +0.02ms
-
text_update

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main5.35ms - 5.87ms-unsure 🔍
-4% - +10%
-0.20ms - +0.55ms
unsure 🔍
-9% - +4%
-0.50ms - +0.25ms
preact-local5.16ms - 5.70msunsure 🔍
-10% - +3%
-0.55ms - +0.20ms
-unsure 🔍
-12% - +1%
-0.68ms - +0.08ms
preact-hooks5.46ms - 6.00msunsure 🔍
-5% - +9%
-0.25ms - +0.50ms
unsure 🔍
-2% - +13%
-0.08ms - +0.68ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.67ms - 0.70ms-unsure 🔍
-5% - +2%
-0.03ms - +0.01ms
faster ✔
2% - 8%
0.02ms - 0.06ms
preact-local0.68ms - 0.71msunsure 🔍
-2% - +5%
-0.01ms - +0.03ms
-faster ✔
1% - 7%
0.01ms - 0.05ms
preact-hooks0.71ms - 0.74msslower ❌
2% - 9%
0.02ms - 0.06ms
slower ❌
1% - 7%
0.01ms - 0.05ms
-
todo

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main29.31ms - 29.57ms-slower ❌
1% - 2%
0.17ms - 0.48ms
faster ✔
2% - 5%
0.70ms - 1.62ms
preact-local29.03ms - 29.20msfaster ✔
1% - 2%
0.17ms - 0.48ms
-faster ✔
3% - 6%
1.04ms - 1.93ms
preact-hooks30.16ms - 31.04msslower ❌
2% - 5%
0.70ms - 1.62ms
slower ❌
4% - 7%
1.04ms - 1.93ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.80ms - 0.80ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
3% - 3%
0.02ms - 0.02ms
preact-local0.80ms - 0.80msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
3% - 3%
0.02ms - 0.02ms
preact-hooks0.83ms - 0.83msslower ❌
3% - 3%
0.02ms - 0.02ms
slower ❌
3% - 3%
0.02ms - 0.02ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

coveralls commented Nov 7, 2023

Coverage Status

coverage: 99.466% (+0.001%) from 99.465%
when pulling 136717e on skip-unmounting
into 9aa4728 on main.

Copy link

github-actions bot commented Nov 7, 2023

Size Change: +18 B (0%)

Total Size: 59.7 kB

Filename Size Change
dist/preact.js 4.5 kB +2 B (0%)
dist/preact.min.js 4.53 kB +3 B (0%)
dist/preact.min.module.js 4.53 kB +2 B (0%)
dist/preact.min.umd.js 4.55 kB +5 B (0%)
dist/preact.module.js 4.52 kB +3 B (0%)
dist/preact.umd.js 4.56 kB +3 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 4 kB 0 B
compat/dist/compat.module.js 3.93 kB 0 B
compat/dist/compat.umd.js 4.08 kB 0 B
debug/dist/debug.js 3.52 kB 0 B
debug/dist/debug.module.js 3.52 kB 0 B
debug/dist/debug.umd.js 3.6 kB 0 B
devtools/dist/devtools.js 232 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 315 B 0 B
hooks/dist/hooks.js 1.53 kB 0 B
hooks/dist/hooks.module.js 1.56 kB 0 B
hooks/dist/hooks.umd.js 1.62 kB 0 B
jsx-runtime/dist/jsxRuntime.js 963 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 938 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 1.04 kB 0 B
test-utils/dist/testUtils.js 453 B 0 B
test-utils/dist/testUtils.module.js 454 B 0 B
test-utils/dist/testUtils.umd.js 536 B 0 B

compressed-size-action

@andrewiggins
Copy link
Member Author

👀
image

@andrewiggins andrewiggins merged commit f269b62 into main Nov 8, 2023
14 checks passed
@andrewiggins andrewiggins deleted the skip-unmounting branch November 8, 2023 00:20
@JoviDeCroock JoviDeCroock mentioned this pull request Nov 10, 2023
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