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

When unmounting, continue with the last DOM element's nextSibling #3878

Merged
merged 2 commits into from
Feb 3, 2023

Conversation

andrewiggins
Copy link
Member

This PR is a follow up to #3875. I realized that we can't do oldChildren[i]._dom.nextSibling cuz oldChildren[i] itself could be Fragment representing a bunch of DOM nodes. We want the last dom node of oldChildren[i] and to get it's last sibling.

@github-actions
Copy link

github-actions bot commented Feb 2, 2023

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -12% - +3% (-18.69ms - +5.23ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -6% - +1% (-3.65ms - +0.74ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +1% (-4.15ms - +14.01ms)
    preact-local vs preact-master
  • filter_list: slower ❌ 0% - 3% (0.02ms - 0.63ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -2% - +2% (-3.04ms - +2.53ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -1% - +4% (-0.40ms - +1.10ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -1% - +5% (-0.03ms - +0.18ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -4% - +1% (-2.39ms - +0.72ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -4% - +10% (-0.12ms - +0.36ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -1% - +1% (-0.02ms - +0.02ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -5% - +6% (-0.52ms - +0.64ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -1% - +0% (-0.05ms - +0.00ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master150.49ms - 165.87ms-unsure 🔍
-4% - +13%
-5.23ms - +18.69ms
unsure 🔍
-6% - +9%
-8.79ms - +13.62ms
preact-local142.30ms - 160.61msunsure 🔍
-12% - +3%
-18.69ms - +5.23ms
-unsure 🔍
-11% - +5%
-16.56ms - +7.94ms
preact-hooks147.62ms - 163.91msunsure 🔍
-9% - +6%
-13.62ms - +8.79ms
unsure 🔍
-5% - +11%
-7.94ms - +16.56ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.42ms - 3.72ms-unsure 🔍
-10% - +3%
-0.36ms - +0.12ms
unsure 🔍
-8% - +4%
-0.29ms - +0.15ms
preact-local3.50ms - 3.88msunsure 🔍
-4% - +10%
-0.12ms - +0.36ms
-unsure 🔍
-6% - +8%
-0.20ms - +0.29ms
preact-hooks3.48ms - 3.80msunsure 🔍
-4% - +8%
-0.15ms - +0.29ms
unsure 🔍
-8% - +6%
-0.29ms - +0.20ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.97ms - 1.02ms-unsure 🔍
-5% - +3%
-0.05ms - +0.03ms
unsure 🔍
-6% - +1%
-0.07ms - +0.01ms
preact-local0.97ms - 1.03msunsure 🔍
-3% - +5%
-0.03ms - +0.05ms
-unsure 🔍
-5% - +3%
-0.06ms - +0.03ms
preact-hooks0.99ms - 1.05msunsure 🔍
-1% - +7%
-0.01ms - +0.07ms
unsure 🔍
-3% - +6%
-0.03ms - +0.06ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.88ms - 1.28ms-unsure 🔍
-5% - +60%
-0.02ms - +0.48ms
unsure 🔍
-6% - +63%
-0.02ms - +0.50ms
preact-local0.70ms - 1.00msunsure 🔍
-42% - -1%
-0.48ms - +0.02ms
-unsure 🔍
-25% - +28%
-0.21ms - +0.23ms
preact-hooks0.68ms - 1.00msunsure 🔍
-43% - -2%
-0.50ms - +0.02ms
unsure 🔍
-27% - +25%
-0.23ms - +0.21ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.42ms - 0.56ms-unsure 🔍
-17% - +24%
-0.08ms - +0.11ms
unsure 🔍
-9% - +32%
-0.04ms - +0.14ms
preact-local0.41ms - 0.54msunsure 🔍
-22% - +16%
-0.11ms - +0.08ms
-unsure 🔍
-12% - +28%
-0.05ms - +0.12ms
preact-hooks0.39ms - 0.50msunsure 🔍
-27% - +6%
-0.14ms - +0.04ms
unsure 🔍
-25% - +10%
-0.12ms - +0.05ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.45ms - 0.74ms-unsure 🔍
-44% - +11%
-0.33ms - +0.10ms
unsure 🔍
-47% - +25%
-0.33ms - +0.18ms
preact-local0.55ms - 0.87msunsure 🔍
-20% - +59%
-0.10ms - +0.33ms
-unsure 🔍
-35% - +48%
-0.22ms - +0.31ms
preact-hooks0.45ms - 0.87msunsure 🔍
-33% - +57%
-0.18ms - +0.33ms
unsure 🔍
-43% - +31%
-0.31ms - +0.22ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.44ms - 0.48ms-faster ✔
1% - 19%
0.00ms - 0.10ms
unsure 🔍
-23% - -1%
-0.13ms - +0.00ms
preact-local0.47ms - 0.56msunsure 🔍
-0% - +22%
+0.00ms - +0.10ms
-unsure 🔍
-16% - +12%
-0.09ms - +0.06ms
preact-hooks0.47ms - 0.58msunsure 🔍
-0% - +28%
-0.00ms - +0.13ms
unsure 🔍
-12% - +17%
-0.06ms - +0.09ms
-

run-final

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.41ms - 0.69ms-unsure 🔍
-33% - +44%
-0.17ms - +0.22ms
unsure 🔍
-29% - +67%
-0.11ms - +0.29ms
preact-local0.39ms - 0.67msunsure 🔍
-40% - +30%
-0.22ms - +0.17ms
-unsure 🔍
-33% - +59%
-0.14ms - +0.26ms
preact-hooks0.32ms - 0.61msunsure 🔍
-50% - +18%
-0.29ms - +0.11ms
unsure 🔍
-47% - +24%
-0.26ms - +0.14ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master62.00ms - 65.52ms-unsure 🔍
-1% - +6%
-0.74ms - +3.65ms
unsure 🔍
-1% - +6%
-0.87ms - +3.44ms
preact-local60.99ms - 63.62msunsure 🔍
-6% - +1%
-3.65ms - +0.74ms
-unsure 🔍
-3% - +3%
-1.98ms - +1.63ms
preact-hooks61.24ms - 63.72msunsure 🔍
-5% - +1%
-3.44ms - +0.87ms
unsure 🔍
-3% - +3%
-1.63ms - +1.98ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.34ms - 3.37ms-unsure 🔍
-1% - +1%
-0.02ms - +0.02ms
unsure 🔍
-1% - +0%
-0.02ms - +0.02ms
preact-local3.34ms - 3.37msunsure 🔍
-1% - +1%
-0.02ms - +0.02ms
-unsure 🔍
-1% - +1%
-0.02ms - +0.02ms
preact-hooks3.34ms - 3.37msunsure 🔍
-0% - +1%
-0.02ms - +0.02ms
unsure 🔍
-1% - +1%
-0.02ms - +0.02ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1214.76ms - 1224.41ms-unsure 🔍
-1% - +0%
-14.01ms - +4.15ms
unsure 🔍
-1% - +0%
-12.52ms - +0.81ms
preact-local1216.82ms - 1232.20msunsure 🔍
-0% - +1%
-4.15ms - +14.01ms
-unsure 🔍
-1% - +1%
-9.89ms - +8.03ms
preact-hooks1220.84ms - 1230.03msunsure 🔍
-0% - +1%
-0.81ms - +12.52ms
unsure 🔍
-1% - +1%
-8.03ms - +9.89ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master25.36ms - 25.36ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local25.36ms - 25.36msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks25.38ms - 25.38msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
filter_list

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master24.28ms - 24.69ms-faster ✔
0% - 3%
0.02ms - 0.63ms
faster ✔
1% - 4%
0.14ms - 1.05ms
preact-local24.58ms - 25.03msslower ❌
0% - 3%
0.02ms - 0.63ms
-unsure 🔍
-3% - +1%
-0.73ms - +0.19ms
preact-hooks24.67ms - 25.48msslower ❌
1% - 4%
0.14ms - 1.05ms
unsure 🔍
-1% - +3%
-0.19ms - +0.73ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.59ms - 1.59ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
1% - 2%
0.02ms - 0.03ms
preact-local1.59ms - 1.59msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
1% - 2%
0.02ms - 0.03ms
preact-hooks1.61ms - 1.62msslower ❌
1% - 2%
0.02ms - 0.03ms
slower ❌
1% - 2%
0.02ms - 0.03ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master123.75ms - 127.88ms-unsure 🔍
-2% - +2%
-2.53ms - +3.04ms
unsure 🔍
-3% - +2%
-3.43ms - +2.52ms
preact-local123.69ms - 127.42msunsure 🔍
-2% - +2%
-3.04ms - +2.53ms
-unsure 🔍
-3% - +2%
-3.55ms - +2.12ms
preact-hooks124.13ms - 128.40msunsure 🔍
-2% - +3%
-2.52ms - +3.43ms
unsure 🔍
-2% - +3%
-2.12ms - +3.55ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master10.41ms - 11.30ms-unsure 🔍
-6% - +5%
-0.64ms - +0.52ms
unsure 🔍
-7% - +4%
-0.81ms - +0.41ms
preact-local10.54ms - 11.29msunsure 🔍
-5% - +6%
-0.52ms - +0.64ms
-unsure 🔍
-6% - +4%
-0.70ms - +0.42ms
preact-hooks10.64ms - 11.47msunsure 🔍
-4% - +7%
-0.41ms - +0.81ms
unsure 🔍
-4% - +6%
-0.42ms - +0.70ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master30.15ms - 31.03ms-unsure 🔍
-4% - +1%
-1.10ms - +0.40ms
unsure 🔍
-4% - +0%
-1.20ms - +0.16ms
preact-local30.34ms - 31.54msunsure 🔍
-1% - +4%
-0.40ms - +1.10ms
-unsure 🔍
-3% - +2%
-0.97ms - +0.62ms
preact-hooks30.60ms - 31.63msunsure 🔍
-1% - +4%
-0.16ms - +1.20ms
unsure 🔍
-2% - +3%
-0.62ms - +0.97ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master4.61ms - 4.64ms-unsure 🔍
-0% - +1%
-0.00ms - +0.05ms
faster ✔
0% - 1%
0.02ms - 0.05ms
preact-local4.59ms - 4.62msunsure 🔍
-1% - +0%
-0.05ms - +0.00ms
-faster ✔
1% - 2%
0.04ms - 0.08ms
preact-hooks4.65ms - 4.67msslower ❌
0% - 1%
0.02ms - 0.05ms
slower ❌
1% - 2%
0.04ms - 0.08ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.81ms - 3.93ms-unsure 🔍
-5% - +1%
-0.18ms - +0.03ms
faster ✔
4% - 9%
0.16ms - 0.36ms
preact-local3.86ms - 4.03msunsure 🔍
-1% - +5%
-0.03ms - +0.18ms
-faster ✔
2% - 7%
0.07ms - 0.30ms
preact-hooks4.04ms - 4.21msslower ❌
4% - 9%
0.16ms - 0.36ms
slower ❌
2% - 8%
0.07ms - 0.30ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.82ms - 0.82ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
faster ✔
2% - 2%
0.01ms - 0.01ms
preact-local0.82ms - 0.82msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-faster ✔
2% - 2%
0.01ms - 0.01ms
preact-hooks0.83ms - 0.83msslower ❌
2% - 2%
0.01ms - 0.01ms
slower ❌
2% - 2%
0.01ms - 0.01ms
-
todo

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master57.88ms - 60.13ms-unsure 🔍
-1% - +4%
-0.72ms - +2.39ms
unsure 🔍
-3% - +2%
-1.95ms - +1.21ms
preact-local57.10ms - 59.24msunsure 🔍
-4% - +1%
-2.39ms - +0.72ms
-unsure 🔍
-5% - +1%
-2.75ms - +0.33ms
preact-hooks58.27ms - 60.48msunsure 🔍
-2% - +3%
-1.21ms - +1.95ms
unsure 🔍
-1% - +5%
-0.33ms - +2.75ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.10ms - 1.11ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
2% - 2%
0.02ms - 0.03ms
preact-local1.10ms - 1.11msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
2% - 2%
0.02ms - 0.03ms
preact-hooks1.13ms - 1.13msslower ❌
2% - 3%
0.02ms - 0.03ms
slower ❌
2% - 3%
0.02ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

coveralls commented Feb 2, 2023

Coverage Status

Coverage: 99.538% (+0.005%) from 99.533% when pulling 5206441 on last-dom-nextsibling into 1de5866 on master.

@github-actions
Copy link

github-actions bot commented Feb 2, 2023

Size Change: +352 B (0%)

Total Size: 53.6 kB

Filename Size Change
dist/preact.js 4.17 kB +58 B (1%)
dist/preact.min.js 4.19 kB +59 B (1%)
dist/preact.min.module.js 4.19 kB +59 B (1%)
dist/preact.min.umd.js 4.22 kB +62 B (1%)
dist/preact.module.js 4.18 kB +55 B (1%)
dist/preact.umd.js 4.23 kB +59 B (1%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.81 kB 0 B
compat/dist/compat.module.js 3.75 kB 0 B
compat/dist/compat.umd.js 3.87 kB 0 B
debug/dist/debug.js 3 kB 0 B
debug/dist/debug.module.js 3.01 kB 0 B
debug/dist/debug.umd.js 3.08 kB 0 B
devtools/dist/devtools.js 231 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.49 kB 0 B
hooks/dist/hooks.module.js 1.52 kB 0 B
hooks/dist/hooks.umd.js 1.57 kB 0 B
jsx-runtime/dist/jsxRuntime.js 360 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 326 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 441 B 0 B
test-utils/dist/testUtils.js 442 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 526 B 0 B

compressed-size-action

@andrewiggins andrewiggins merged commit ef708b9 into master Feb 3, 2023
@andrewiggins andrewiggins deleted the last-dom-nextsibling branch February 3, 2023 21:20
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.

None yet

4 participants