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

fix(child-diffing): Should shift keyed fragmented lists #4448

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Jul 18, 2024

Fixes #4447

oldDom would become stale when we were diving through a reorderChildren sequence, this implements the same fix as we have in children.js where we look for up to date dom siblings when the parent does not contain the oldDom, implying it's unmounted.

Copy link

github-actions bot commented Jul 18, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -2% - +2% (-16.02ms - +18.83ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +3% (-0.21ms - +0.46ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -3% - +1% (-2.24ms - +0.87ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +3% (-0.57ms - +0.54ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +3% (-0.93ms - +2.39ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +1% (-0.09ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +1% (-0.54ms - +0.24ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -3% - +2% (-1.17ms - +0.74ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +2% (-0.14ms - +0.32ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +1% (-0.01ms - +0.04ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local881.84ms - 907.54ms-unsure 🔍
-2% - +2%
-16.02ms - +18.83ms
preact-main881.52ms - 905.06msunsure 🔍
-2% - +2%
-18.83ms - +16.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local25.15ms - 25.15ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main25.15ms - 25.15msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.51ms - 17.17ms-unsure 🔍
-1% - +3%
-0.21ms - +0.46ms
preact-main16.65ms - 16.78msunsure 🔍
-3% - +1%
-0.46ms - +0.21ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.70ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.69ms - 1.70msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local70.29ms - 71.87ms-unsure 🔍
-3% - +1%
-2.24ms - +0.87ms
preact-main70.42ms - 73.10msunsure 🔍
-1% - +3%
-0.87ms - +2.24ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local15.55ms - 15.92ms-unsure 🔍
-1% - +2%
-0.14ms - +0.32ms
preact-main15.51ms - 15.78msunsure 🔍
-2% - +1%
-0.32ms - +0.14ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.59ms - 17.33ms-unsure 🔍
-3% - +3%
-0.57ms - +0.54ms
preact-main16.55ms - 17.39msunsure 🔍
-3% - +3%
-0.54ms - +0.57ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.61ms - 4.61ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main4.61ms - 4.61msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local73.98ms - 76.25ms-unsure 🔍
-1% - +3%
-0.93ms - +2.39ms
preact-main73.17ms - 75.60msunsure 🔍
-3% - +1%
-2.39ms - +0.93ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.54ms - 3.57ms-unsure 🔍
-0% - +1%
-0.01ms - +0.04ms
preact-main3.52ms - 3.55msunsure 🔍
-1% - +0%
-0.04ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local28.93ms - 29.52ms-unsure 🔍
-1% - +2%
-0.17ms - +0.58ms
preact-main28.79ms - 29.26msunsure 🔍
-2% - +1%
-0.58ms - +0.17ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local33.89ms - 35.74ms-unsure 🔍
-3% - +5%
-0.96ms - +1.71ms
preact-main33.48ms - 35.40msunsure 🔍
-5% - +3%
-1.71ms - +0.96ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local24.81ms - 25.40ms-unsure 🔍
-1% - +2%
-0.28ms - +0.47ms
preact-main24.78ms - 25.24msunsure 🔍
-2% - +1%
-0.47ms - +0.28ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local29.91ms - 31.31ms-unsure 🔍
-1% - +6%
-0.23ms - +1.69ms
preact-main29.23ms - 30.53msunsure 🔍
-5% - +1%
-1.69ms - +0.23ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local21.53ms - 23.31ms-unsure 🔍
-7% - +3%
-1.54ms - +0.80ms
preact-main22.04ms - 23.55msunsure 🔍
-4% - +7%
-0.80ms - +1.54ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local22.45ms - 23.33ms-unsure 🔍
-4% - +2%
-0.99ms - +0.38ms
preact-main22.66ms - 23.72msunsure 🔍
-2% - +4%
-0.38ms - +0.99ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.89ms - 1.96ms-unsure 🔍
-5% - +1%
-0.09ms - +0.01ms
preact-main1.93ms - 2.00msunsure 🔍
-1% - +5%
-0.01ms - +0.09ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.98ms - 0.98ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-main0.98ms - 0.98msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local26.54ms - 27.07ms-unsure 🔍
-2% - +1%
-0.54ms - +0.24ms
preact-main26.66ms - 27.25msunsure 🔍
-1% - +2%
-0.24ms - +0.54ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.25ms - 1.25ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.25ms - 1.25msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local32.78ms - 34.20ms-unsure 🔍
-3% - +2%
-1.17ms - +0.74ms
preact-main33.08ms - 34.35msunsure 🔍
-2% - +4%
-0.74ms - +1.17ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.55ms - 3.55ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main3.55ms - 3.55msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-

tachometer-reporter-action v2 for Benchmarks

@JoviDeCroock JoviDeCroock force-pushed the fragment-like-keyed-children branch from a9293a2 to eb63908 Compare July 18, 2024 18:54
Copy link

github-actions bot commented Jul 18, 2024

Size Change: -31 B (-0.05%)

Total Size: 62 kB

Filename Size Change
dist/preact.js 4.72 kB -5 B (-0.11%)
dist/preact.min.js 4.75 kB -5 B (-0.11%)
dist/preact.min.module.js 4.75 kB -5 B (-0.11%)
dist/preact.min.umd.js 4.77 kB -5 B (-0.1%)
dist/preact.module.js 4.74 kB -6 B (-0.13%)
dist/preact.umd.js 4.79 kB -5 B (-0.1%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 4.1 kB
compat/dist/compat.module.js 4.03 kB
compat/dist/compat.umd.js 4.17 kB
debug/dist/debug.js 3.7 kB
debug/dist/debug.module.js 3.71 kB
debug/dist/debug.umd.js 3.78 kB
devtools/dist/devtools.js 259 B
devtools/dist/devtools.module.js 273 B
devtools/dist/devtools.umd.js 345 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

@coveralls
Copy link

coveralls commented Jul 18, 2024

Coverage Status

coverage: 99.486% (-0.1%) from 99.614%
when pulling 8c2c662 on fragment-like-keyed-children
into 16c7fb7 on main.

@JoviDeCroock JoviDeCroock force-pushed the fragment-like-keyed-children branch from 5593486 to 559cef5 Compare July 18, 2024 19:50
@JoviDeCroock JoviDeCroock merged commit f573891 into main Jul 19, 2024
12 of 13 checks passed
@JoviDeCroock JoviDeCroock deleted the fragment-like-keyed-children branch July 19, 2024 09:12
@JoviDeCroock JoviDeCroock mentioned this pull request Jul 20, 2024
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.

Failed to execute insertBefore DOMException happens on rendering list of items
3 participants