preact icon indicating copy to clipboard operation
preact copied to clipboard

propose removal of createRoot from core

Open JoviDeCroock opened this issue 2 years ago • 5 comments

as it is only available in react-dom/client

let's look at the byte-size impact to make judgement

JoviDeCroock avatar Jul 03 '22 11:07 JoviDeCroock

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -3% - +2% (-5.48ms - +3.31ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -3% - +3% (-2.00ms - +2.33ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: 4.76ms - 5.35ms
  • 07_create10k: unsure 🔍 -1% - +2% (-16.13ms - +21.31ms)
    preact-local vs preact-master
  • 07_create10k: 1203.35ms - 1223.05ms
  • filter_list: unsure 🔍 -2% - +1% (-6.98ms - +3.55ms)
    preact-local vs preact-master
  • filter_list: 228.71ms - 231.92ms
  • hydrate1k: unsure 🔍 -7% - +8% (-8.55ms - +10.19ms)
    preact-local vs preact-master
  • hydrate1k: 107.45ms - 123.16ms
  • many_updates: unsure 🔍 -1% - +4% (-3.82ms - +11.24ms)
    preact-local vs preact-master
  • many_updates: 227.21ms - 233.11ms
  • text_update: faster ✔ 0% - 4% (0.23ms - 2.36ms)
    preact-local vs preact-master
  • text_update: 49.91ms - 51.07ms
  • todo: faster ✔ 1% - 5% (0.62ms - 3.28ms)
    preact-local vs preact-master
  • todo: 40.68ms - 41.52ms

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: 4.20ms - 4.23ms
  • 07_create10k: unsure 🔍 -0% - +0% (-0.04ms - +0.02ms)
    preact-local vs preact-master
  • 07_create10k: 28.36ms - 28.46ms
  • filter_list: slower ❌ 0% - 1% (0.01ms - 0.01ms)
    preact-local vs preact-master
  • filter_list: 2.14ms - 2.14ms
  • hydrate1k: unsure 🔍 -0% - -0% (-0.01ms - -0.00ms)
    preact-local vs preact-master
  • hydrate1k: 6.91ms - 6.91ms
  • many_updates: unsure 🔍 -0% - +0% (-0.02ms - +0.00ms)
    preact-local vs preact-master
  • many_updates: 5.76ms - 5.76ms
  • text_update: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-master
  • text_update: 1.30ms - 1.31ms
  • todo: slower ❌ 1% - 3% (0.01ms - 0.04ms)
    preact-local vs preact-master
  • todo: 1.35ms - 1.39ms

Results

02_replace1k
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 80
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master197.66ms - 204.19ms-unsure 🔍
-2% - +3%
-3.31ms - +5.48ms
preact-local196.90ms - 202.79msunsure 🔍
-3% - +2%
-5.48ms - +3.31ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.17ms - 4.18ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-local4.16ms - 4.17msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master66.56ms - 68.60ms-unsure 🔍
-1% - +3%
-0.80ms - +2.23ms
preact-local65.75ms - 67.99msunsure 🔍
-3% - +1%
-2.23ms - +0.80ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master84.21ms - 86.86ms-unsure 🔍
-1% - +3%
-0.97ms - +2.73ms
preact-local83.36ms - 85.95msunsure 🔍
-3% - +1%
-2.73ms - +0.97ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master80.97ms - 83.43ms-unsure 🔍
-4% - +1%
-3.09ms - +1.05ms
preact-local81.55ms - 84.89msunsure 🔍
-1% - +4%
-1.05ms - +3.09ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master197.72ms - 204.24ms-unsure 🔍
-2% - +3%
-3.32ms - +5.47ms
preact-local196.96ms - 202.85msunsure 🔍
-3% - +2%
-5.47ms - +3.32ms
-
03_update10th1k_x16
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 50
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master69.01ms - 72.36ms-unsure 🔍
-3% - +3%
-2.33ms - +2.00ms
preact-local69.48ms - 72.23msunsure 🔍
-3% - +3%
-2.00ms - +2.33ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.20ms - 4.20ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-local4.20ms - 4.20msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-
03_update10th1k_x16
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
4.76ms - 5.35ms-

usedJSHeapSize

VersionAvg timevs
4.20ms - 4.23ms-
07_create10k
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 50
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1355.40ms - 1382.05ms-unsure 🔍
-2% - +1%
-21.31ms - +16.13ms
preact-local1358.16ms - 1384.46msunsure 🔍
-1% - +2%
-16.13ms - +21.31ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master28.34ms - 28.39ms-unsure 🔍
-0% - +0%
-0.02ms - +0.04ms
preact-local28.33ms - 28.38msunsure 🔍
-0% - +0%
-0.04ms - +0.02ms
-
07_create10k
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
1203.35ms - 1223.05ms-

usedJSHeapSize

VersionAvg timevs
28.36ms - 28.46ms-
filter_list
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 50
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master324.17ms - 332.34ms-unsure 🔍
-1% - +2%
-3.55ms - +6.98ms
preact-local323.23ms - 329.85msunsure 🔍
-2% - +1%
-6.98ms - +3.55ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master2.13ms - 2.13ms-faster ✔
0% - 1%
0.01ms - 0.01ms
preact-local2.14ms - 2.14msslower ❌
0% - 1%
0.01ms - 0.01ms
-
filter_list
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
228.71ms - 231.92ms-

usedJSHeapSize

VersionAvg timevs
2.14ms - 2.14ms-
hydrate1k
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 80
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master118.06ms - 131.12ms-unsure 🔍
-8% - +7%
-10.19ms - +8.55ms
preact-local118.69ms - 132.13msunsure 🔍
-7% - +8%
-8.55ms - +10.19ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.92ms - 6.92ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-local6.91ms - 6.91msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
hydrate1k
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
107.45ms - 123.16ms-

usedJSHeapSize

VersionAvg timevs
6.91ms - 6.91ms-
many_updates
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 50
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master278.41ms - 289.23ms-unsure 🔍
-4% - +1%
-11.24ms - +3.82ms
preact-local282.29ms - 292.77msunsure 🔍
-1% - +4%
-3.82ms - +11.24ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master5.77ms - 5.79ms-unsure 🔍
-0% - +0%
-0.00ms - +0.02ms
preact-local5.77ms - 5.77msunsure 🔍
-0% - +0%
-0.02ms - +0.00ms
-
many_updates
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
227.21ms - 233.11ms-

usedJSHeapSize

VersionAvg timevs
5.76ms - 5.76ms-
text_update
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 70
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master54.29ms - 56.03ms-slower ❌
0% - 4%
0.23ms - 2.36ms
preact-local53.24ms - 54.48msfaster ✔
0% - 4%
0.23ms - 2.36ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.31ms - 1.31ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-local1.31ms - 1.31msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
text_update
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
49.91ms - 51.07ms-

usedJSHeapSize

VersionAvg timevs
1.30ms - 1.31ms-
todo
  • Browser: chrome-headless 103.0.5060.53
  • Sample size: 100
  • Built by: Benchmarks #839
  • Commit: 277086e

duration

VersionAvg timevs preact-mastervs preact-local
preact-master58.40ms - 60.29ms-slower ❌
1% - 6%
0.62ms - 3.28ms
preact-local56.46ms - 58.33msfaster ✔
1% - 5%
0.62ms - 3.28ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.33ms - 1.35ms-faster ✔
1% - 3%
0.01ms - 0.04ms
preact-local1.35ms - 1.38msslower ❌
1% - 3%
0.01ms - 0.04ms
-
todo
  • Browser: chrome-headless 104.0.5112.101
  • Sample size: 50
  • Built by: Benchmarks #861
  • Commit: cfb6ce4

duration

VersionAvg timevs
40.68ms - 41.52ms-

usedJSHeapSize

VersionAvg timevs
1.35ms - 1.39ms-

tachometer-reporter-action v2 for Benchmarks

github-actions[bot] avatar Jul 03 '22 11:07 github-actions[bot]

Size Change: -129 B (0%)

Total Size: 37.3 kB

Filename Size Change
compat/dist/compat.js 3.41 kB -17 B (0%)
compat/dist/compat.umd.js 3.49 kB -18 B (0%)
dist/preact.js 4.55 kB -31 B (0%)
dist/preact.min.js 4.6 kB -32 B (0%)
dist/preact.umd.js 4.62 kB -31 B (0%)
ℹ️ View Unchanged
Filename Size Change
debug/dist/debug.js 3.08 kB 0 B
debug/dist/debug.umd.js 3.17 kB 0 B
devtools/dist/devtools.js 232 B 0 B
devtools/dist/devtools.umd.js 316 B 0 B
hooks/dist/hooks.js 1.36 kB 0 B
hooks/dist/hooks.umd.js 1.46 kB 0 B
jsx-runtime/dist/jsxRuntime.js 342 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 425 B 0 B
server/dist/server.js 2.6 kB 0 B
server/dist/server.umd.js 2.69 kB 0 B
test-utils/dist/testUtils.js 437 B 0 B
test-utils/dist/testUtils.umd.js 522 B 0 B

compressed-size-action

github-actions[bot] avatar Jul 03 '22 11:07 github-actions[bot]

Coverage Status

Coverage decreased (-0.002%) to 99.446% when pulling 277086e65fbd95d7c2006884ce18b087bef0f277 on proposal-remove-create-root into 580cbad052234a5868e0ab657209a79448ba774c on main.

coveralls avatar Jul 06 '22 11:07 coveralls

30b is compelling, but I'm waffling on this for some reason. I liked the separation we were getting with createRoot. That said, our createRoot was already different from React's in a way that would likely be confusing for folks.. (createRoot().hydrate() vs hydrateRoot().render()?).

I need to think more about it though.

developit avatar Jul 13 '22 23:07 developit

@developit yes it was slightly different already

JoviDeCroock avatar Aug 23 '22 20:08 JoviDeCroock

Closing due to inactivity

JoviDeCroock avatar Apr 24 '23 10:04 JoviDeCroock