Skip to content

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Aug 20, 2025

Size changes are quite nice

@coveralls
Copy link

coveralls commented Aug 20, 2025

Coverage Status

coverage: 99.536%. remained the same
when pulling eba3fa6 on save-bytes-with-ecma-2020
into 9c44db8 on main.

Copy link

github-actions bot commented Aug 20, 2025

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -0% - +0% (-3.47ms - +3.14ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.02ms - +0.05ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-0.88ms - +2.42ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +4% (-0.52ms - +0.68ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +2% (-1.04ms - +1.61ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -6% - +0% (-0.11ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +1% (-0.61ms - +0.43ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -3% - +4% (-0.98ms - +1.28ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.02ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -4% - +9% (-0.25ms - +0.59ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.03ms - +0.02ms)
    preact-local vs preact-main
  • text-update: faster ✔ 0% - 4% (0.00ms - 0.04ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local973.39ms - 978.38ms-unsure 🔍
-0% - +0%
-3.47ms - +3.14ms
preact-main973.89ms - 978.22msunsure 🔍
-0% - +0%
-3.14ms - +3.47ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.03ms - 19.03ms-unsure 🔍
-0% - +0%
-0.02ms - +0.00ms
preact-main19.03ms - 19.06msunsure 🔍
-0% - +0%
-0.00ms - +0.02ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.52ms - 16.58ms-unsure 🔍
-0% - +0%
-0.02ms - +0.05ms
preact-main16.52ms - 16.56msunsure 🔍
-0% - +0%
-0.05ms - +0.02ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local72.38ms - 74.58ms-unsure 🔍
-1% - +3%
-0.88ms - +2.42ms
preact-main71.48ms - 73.93msunsure 🔍
-3% - +1%
-2.42ms - +0.88ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local6.32ms - 6.94ms-unsure 🔍
-4% - +9%
-0.25ms - +0.59ms
preact-main6.17ms - 6.75msunsure 🔍
-9% - +4%
-0.59ms - +0.25ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.35ms - 17.00ms-unsure 🔍
-3% - +4%
-0.52ms - +0.68ms
preact-main16.09ms - 17.10msunsure 🔍
-4% - +3%
-0.68ms - +0.52ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.72ms - 3.72ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.72ms - 3.72msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local71.56ms - 73.56ms-unsure 🔍
-1% - +2%
-1.04ms - +1.61ms
preact-main71.40ms - 73.15msunsure 🔍
-2% - +1%
-1.61ms - +1.04ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.02ms - 3.06ms-unsure 🔍
-1% - +1%
-0.03ms - +0.02ms
preact-main3.02ms - 3.06msunsure 🔍
-1% - +1%
-0.02ms - +0.03ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local26.50ms - 27.38ms-unsure 🔍
-3% - +2%
-0.80ms - +0.42ms
preact-main26.71ms - 27.55msunsure 🔍
-2% - +3%
-0.42ms - +0.80ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local34.41ms - 35.42ms-unsure 🔍
-0% - +3%
-0.14ms - +1.15ms
preact-main34.01ms - 34.81msunsure 🔍
-3% - +0%
-1.15ms - +0.14ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local35.05ms - 35.89ms-unsure 🔍
-0% - +3%
-0.12ms - +0.98ms
preact-main34.68ms - 35.40msunsure 🔍
-3% - +0%
-0.98ms - +0.12ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local27.76ms - 28.44ms-unsure 🔍
-2% - +1%
-0.62ms - +0.31ms
preact-main27.94ms - 28.58msunsure 🔍
-1% - +2%
-0.31ms - +0.62ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local24.99ms - 26.23ms-unsure 🔍
-3% - +4%
-0.69ms - +0.96ms
preact-main24.93ms - 26.02msunsure 🔍
-4% - +3%
-0.96ms - +0.69ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local22.90ms - 23.73ms-unsure 🔍
-4% - +1%
-0.98ms - +0.24ms
preact-main23.24ms - 24.14msunsure 🔍
-1% - +4%
-0.24ms - +0.98ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 230
  • Built by: CI #5085
  • Commit: aa6d6e5

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.85ms - 1.92ms-unsure 🔍
-6% - +0%
-0.11ms - +0.01ms
preact-main1.89ms - 1.98msunsure 🔍
-0% - +6%
-0.01ms - +0.11ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.97ms - 0.98ms-faster ✔
0% - 4%
0.00ms - 0.04ms
preact-main0.98ms - 1.01msslower ❌
0% - 4%
0.00ms - 0.04ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.61ms - 32.44ms-unsure 🔍
-2% - +1%
-0.61ms - +0.43ms
preact-main31.81ms - 32.42msunsure 🔍
-1% - +2%
-0.43ms - +0.61ms
-

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-local29.96ms - 31.54ms-unsure 🔍
-3% - +4%
-0.98ms - +1.28ms
preact-main29.79ms - 31.40msunsure 🔍
-4% - +3%
-1.28ms - +0.98ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.93ms - 2.94ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-main2.93ms - 2.94msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-

tachometer-reporter-action v2 for CI

Copy link

Size Change: -14 B (-0.03%)

Total Size: 47.5 kB

Filename Size Change
dist/preact.js 4.7 kB -11 B (-0.23%)
dist/preact.mjs 4.72 kB -3 B (-0.06%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 3.9 kB
compat/dist/compat.mjs 3.82 kB
compat/dist/compat.umd.js 3.95 kB
debug/dist/debug.js 3.9 kB
debug/dist/debug.mjs 3.9 kB
debug/dist/debug.umd.js 3.98 kB
devtools/dist/devtools.js 263 B
devtools/dist/devtools.mjs 273 B
devtools/dist/devtools.umd.js 348 B
dist/preact.umd.js 4.78 kB
hooks/dist/hooks.js 1.55 kB
hooks/dist/hooks.mjs 1.58 kB
hooks/dist/hooks.umd.js 1.62 kB
jsx-runtime/dist/jsxRuntime.js 892 B
jsx-runtime/dist/jsxRuntime.mjs 861 B
jsx-runtime/dist/jsxRuntime.umd.js 966 B
test-utils/dist/testUtils.js 473 B
test-utils/dist/testUtils.mjs 473 B
test-utils/dist/testUtils.umd.js 555 B

compressed-size-action

@rschristian
Copy link
Member

Size benefits would likely be much greater if we made more adjustments to the source too, depending on perf characteristics. ES2020 means ES6 classes, which might save some bytes for BaseComponent, optional chaining in a few places, optional catch bindings (though perhaps terser already does this), etc. There'd be more opportunities besides the -14b I think, though that might mean dealing with Microbundle.

A 7 year jump in minimum browser versions probably isn't too unreasonable given the 6 year lifespan of X, though that is a big jump.

@JoviDeCroock
Copy link
Member Author

Did a lot of the work in #4883 however it's really hard to make ESBuild work well with CJS/UMD, maybe I should try rolldown 😅

@rschristian
Copy link
Member

I mean, we could just add a more minimal Rollup config? Speed is great, but if the newer tools can't produce output worth a damn, we can keep using older tools? That being said, Vitest is still pretty much unusable on my system so Microbundle might only seem acceptably slow to me.

I wouldn't be surprised if Microbundle is considerably slower than a more modern & purpose-built Rollup/Babel config too, maybe I'll take a look after work.

@JoviDeCroock JoviDeCroock deleted the save-bytes-with-ecma-2020 branch August 22, 2025 06:12
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