Skip to content

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Aug 9, 2025

General changes

  • Drops umd output
  • CJS uses destructured require rather than namespace (ESBuild limitation, we could transform but... not sure if it's worth it)
  • Lifts syntax to ES2020
  • Removes microbundle (a lot less deps)

TODO

  • Chase down size diff in compat.mjs
  • Refactor the script
  • Undo src change

@coveralls
Copy link

coveralls commented Aug 9, 2025

Coverage Status

coverage: 100.0% (+0.5%) from 99.536%
when pulling 1953883 on better-build
into 68b30fe on main.

Copy link

github-actions bot commented Aug 9, 2025

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -0% - +1% (-0.35ms - +6.41ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.03ms - +0.13ms)
    preact-local vs preact-main
  • hydrate1k: faster ✔ 4% - 7% (2.44ms - 4.75ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +1% (-0.06ms - +0.09ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.62ms - +0.89ms)
    preact-local vs preact-main
  • text-update: slower ❌ 3% - 11% (0.06ms - 0.20ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +2% (-0.14ms - +0.56ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +3% (-1.09ms - +0.83ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: faster ✔ 1% - 1% (0.17ms - 0.17ms)
    preact-local vs preact-main
  • filter-list: faster ✔ 11% - 11% (0.17ms - 0.18ms)
    preact-local vs preact-main
  • hydrate1k: slower ❌ 7% - 18% (0.45ms - 1.07ms)
    preact-local vs preact-main
  • many-updates: faster ✔ 5% - 5% (0.17ms - 0.17ms)
    preact-local vs preact-main
  • replace1k: faster ✔ 6% - 6% (0.17ms - 0.17ms)
    preact-local vs preact-main
  • text-update: faster ✔ 15% - 19% (0.15ms - 0.19ms)
    preact-local vs preact-main
  • todo: faster ✔ 13% - 14% (0.16ms - 0.17ms)
    preact-local vs preact-main
  • update10th1k: faster ✔ 6% - 6% (0.17ms - 0.18ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local959.84ms - 965.07ms-unsure 🔍
-0% - +1%
-0.35ms - +6.41ms
preact-main957.29ms - 961.56msunsure 🔍
-1% - +0%
-6.41ms - +0.35ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local18.86ms - 18.86ms-faster ✔
1% - 1%
0.17ms - 0.17ms
preact-main19.03ms - 19.03msslower ❌
1% - 1%
0.17ms - 0.17ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.48ms - 16.63ms-unsure 🔍
-0% - +1%
-0.03ms - +0.13ms
preact-main16.48ms - 16.53msunsure 🔍
-1% - +0%
-0.13ms - +0.03ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.36ms - 1.36ms-faster ✔
11% - 11%
0.17ms - 0.18ms
preact-main1.53ms - 1.53msslower ❌
12% - 13%
0.17ms - 0.18ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local64.02ms - 65.54ms-faster ✔
4% - 7%
2.44ms - 4.75ms
preact-main67.51ms - 69.24msslower ❌
4% - 7%
2.44ms - 4.75ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local6.80ms - 7.11ms-slower ❌
7% - 18%
0.45ms - 1.07ms
preact-main5.92ms - 6.46msfaster ✔
7% - 15%
0.45ms - 1.07ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.55ms - 16.67ms-unsure 🔍
-0% - +1%
-0.06ms - +0.09ms
preact-main16.54ms - 16.64msunsure 🔍
-1% - +0%
-0.09ms - +0.06ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.54ms - 3.55ms-faster ✔
5% - 5%
0.17ms - 0.17ms
preact-main3.71ms - 3.72msslower ❌
5% - 5%
0.17ms - 0.17ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5062
  • Commit: 1953883

duration

VersionAvg timevs preact-localvs preact-main
preact-local60.42ms - 61.48ms-unsure 🔍
-1% - +1%
-0.62ms - +0.89ms
preact-main60.28ms - 61.35msunsure 🔍
-1% - +1%
-0.89ms - +0.62ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.81ms - 2.81ms-faster ✔
6% - 6%
0.17ms - 0.17ms
preact-main2.98ms - 2.98msslower ❌
6% - 6%
0.17ms - 0.17ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local23.71ms - 24.53ms-faster ✔
4% - 9%
1.07ms - 2.22ms
preact-main25.36ms - 26.17msslower ❌
4% - 9%
1.07ms - 2.22ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local32.58ms - 33.61ms-unsure 🔍
-2% - +2%
-0.81ms - +0.61ms
preact-main32.70ms - 33.69msunsure 🔍
-2% - +2%
-0.61ms - +0.81ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local30.11ms - 30.84ms-unsure 🔍
-1% - +2%
-0.39ms - +0.65ms
preact-main29.97ms - 30.72msunsure 🔍
-2% - +1%
-0.65ms - +0.39ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local26.16ms - 26.89ms-unsure 🔍
-3% - +0%
-0.92ms - +0.10ms
preact-main26.58ms - 27.28msunsure 🔍
-0% - +3%
-0.10ms - +0.92ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local23.73ms - 24.99ms-slower ❌
0% - 7%
0.02ms - 1.72ms
preact-main22.91ms - 24.06msfaster ✔
0% - 7%
0.02ms - 1.72ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local20.76ms - 21.59ms-unsure 🔍
-3% - +3%
-0.54ms - +0.61ms
preact-main20.74ms - 21.53msunsure 🔍
-3% - +3%
-0.61ms - +0.54ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 240
  • Built by: CI #5062
  • Commit: 1953883

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.00ms - 2.12ms-slower ❌
3% - 11%
0.06ms - 0.20ms
preact-main1.89ms - 1.96msfaster ✔
3% - 10%
0.06ms - 0.20ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.82ms - 0.84ms-faster ✔
15% - 19%
0.15ms - 0.19ms
preact-main0.99ms - 1.02msslower ❌
18% - 23%
0.15ms - 0.19ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.03ms - 31.66ms-unsure 🔍
-0% - +2%
-0.14ms - +0.56ms
preact-main30.99ms - 31.29msunsure 🔍
-2% - +0%
-0.56ms - +0.14ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.07ms - 1.09ms-faster ✔
13% - 14%
0.16ms - 0.17ms
preact-main1.24ms - 1.25msslower ❌
15% - 16%
0.16ms - 0.17ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local29.17ms - 30.23ms-unsure 🔍
-4% - +3%
-1.09ms - +0.83ms
preact-main29.03ms - 30.63msunsure 🔍
-3% - +4%
-0.83ms - +1.09ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.76ms - 2.77ms-faster ✔
6% - 6%
0.17ms - 0.18ms
preact-main2.93ms - 2.94msslower ❌
6% - 7%
0.17ms - 0.18ms
-

tachometer-reporter-action v2 for CI

Copy link

github-actions bot commented Aug 9, 2025

Size Change: -16.1 kB (-33.86%) 🎉

Total Size: 31.4 kB

Filename Size Change
compat/dist/compat.js 3.74 kB -157 B (-4.03%)
compat/dist/compat.mjs 3.94 kB +120 B (+3.14%)
compat/dist/compat.umd.js 0 B -3.95 kB (removed) 🏆
debug/dist/debug.js 3.91 kB +14 B (+0.36%)
debug/dist/debug.mjs 3.92 kB +14 B (+0.36%)
debug/dist/debug.umd.js 0 B -3.98 kB (removed) 🏆
devtools/dist/devtools.js 280 B +20 B (+7.69%) 🔍
devtools/dist/devtools.mjs 280 B +9 B (+3.32%)
devtools/dist/devtools.umd.js 0 B -346 B (removed) 🏆
dist/preact.js 4.75 kB +47 B (+1%)
dist/preact.mjs 4.76 kB +45 B (+0.95%)
dist/preact.umd.js 0 B -4.77 kB (removed) 🏆
hooks/dist/hooks.js 1.56 kB +5 B (+0.32%)
hooks/dist/hooks.mjs 1.57 kB -7 B (-0.44%)
hooks/dist/hooks.umd.js 0 B -1.62 kB (removed) 🏆
jsx-runtime/dist/jsxRuntime.js 857 B -35 B (-3.92%)
jsx-runtime/dist/jsxRuntime.mjs 851 B -10 B (-1.16%)
jsx-runtime/dist/jsxRuntime.umd.js 0 B -966 B (removed) 🏆
test-utils/dist/testUtils.js 499 B +26 B (+5.5%) 🔍
test-utils/dist/testUtils.mjs 496 B +23 B (+4.86%) 🔍
test-utils/dist/testUtils.umd.js 0 B -555 B (removed) 🏆

compressed-size-action

@JoviDeCroock JoviDeCroock force-pushed the better-build branch 9 times, most recently from ffd5899 to 132d9c2 Compare August 9, 2025 15:53
@JoviDeCroock JoviDeCroock force-pushed the better-build branch 2 times, most recently from dc82203 to efc60d9 Compare August 10, 2025 10:41
@JoviDeCroock JoviDeCroock force-pushed the better-build branch 4 times, most recently from 020e813 to 623ddd5 Compare August 10, 2025 11:14
@rschristian
Copy link
Member

rschristian commented Aug 11, 2025

Lifts syntax to ES2020

I was under the impression that the ES2020 setting was just a temporary thing whilst you were working on this, is that not the case? I feel that's a bit too new to place our floor at, and I'm not sure it's necessary -- do we/the transpiler even use anything that new? ES2017 or so, IMO, should be as new as it gets if absolutely required.

Moving past ES5 also likely calls for investigation into ES6 classes, they'll certainly be smaller but perf could go either way. Not necessarily related to this PR of course, just opens up a few new options that could be good for us.

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