Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Test whether reducing bits leads to memory improvements #4586

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Nov 30, 2024

Initial assumption was this would reduce memory consumption but... the byte size is also pretty great 😅

Copy link

github-actions bot commented Nov 30, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +1% (-4.79ms - +7.31ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.07ms - +0.08ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-0.48ms - +2.00ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -4% - +3% (-0.68ms - +0.45ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +1% (-0.32ms - +0.58ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -6% - +4% (-0.14ms - +0.09ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +2% (-0.31ms - +0.52ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -3% - +2% (-1.07ms - +0.78ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +2% (-0.00ms - +0.03ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -4% - +3% (-0.53ms - +0.35ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.02ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.02ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -0% - +1% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: slower ❌ 0% - 1% (0.00ms - 0.03ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local932.38ms - 942.03ms-unsure 🔍
-1% - +1%
-4.79ms - +7.31ms
preact-main932.30ms - 939.59msunsure 🔍
-1% - +1%
-7.31ms - +4.79ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local24.84ms - 24.86ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main24.85ms - 24.85msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.55ms - 16.65ms-unsure 🔍
-0% - +1%
-0.07ms - +0.08ms
preact-main16.53ms - 16.65msunsure 🔍
-1% - +0%
-0.08ms - +0.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.66ms - 1.69ms-unsure 🔍
-0% - +2%
-0.00ms - +0.03ms
preact-main1.65ms - 1.67msunsure 🔍
-2% - +0%
-0.03ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local73.88ms - 75.68ms-unsure 🔍
-1% - +3%
-0.48ms - +2.00ms
preact-main73.16ms - 74.87msunsure 🔍
-3% - +1%
-2.00ms - +0.48ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local11.39ms - 11.99ms-unsure 🔍
-4% - +3%
-0.53ms - +0.35ms
preact-main11.46ms - 12.10msunsure 🔍
-3% - +5%
-0.35ms - +0.53ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local15.53ms - 16.15ms-unsure 🔍
-4% - +3%
-0.68ms - +0.45ms
preact-main15.48ms - 16.43msunsure 🔍
-3% - +4%
-0.45ms - +0.68ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.50ms - 4.52ms-unsure 🔍
-0% - +0%
-0.02ms - +0.01ms
preact-main4.50ms - 4.52msunsure 🔍
-0% - +0%
-0.01ms - +0.02ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #4136
  • Commit: 11125b7

duration

VersionAvg timevs preact-localvs preact-main
preact-local65.31ms - 65.94ms-unsure 🔍
-0% - +1%
-0.32ms - +0.58ms
preact-main65.17ms - 65.81msunsure 🔍
-1% - +0%
-0.58ms - +0.32ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.58ms - 3.61ms-unsure 🔍
-1% - +1%
-0.02ms - +0.02ms
preact-main3.57ms - 3.60msunsure 🔍
-1% - +1%
-0.02ms - +0.02ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local30.17ms - 30.93ms-unsure 🔍
-0% - +3%
-0.10ms - +0.92ms
preact-main29.80ms - 30.49msunsure 🔍
-3% - +0%
-0.92ms - +0.10ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local36.12ms - 37.79ms-slower ❌
0% - 7%
0.16ms - 2.33ms
preact-main35.02ms - 36.40msfaster ✔
1% - 6%
0.16ms - 2.33ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local29.05ms - 29.93ms-unsure 🔍
-3% - +2%
-0.80ms - +0.50ms
preact-main29.17ms - 30.11msunsure 🔍
-2% - +3%
-0.50ms - +0.80ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local22.21ms - 22.67ms-unsure 🔍
-3% - +1%
-0.57ms - +0.28ms
preact-main22.23ms - 22.95msunsure 🔍
-1% - +3%
-0.28ms - +0.57ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local20.88ms - 21.05ms-unsure 🔍
-4% - +0%
-0.96ms - +0.02ms
preact-main20.95ms - 21.92msunsure 🔍
-0% - +5%
-0.02ms - +0.96ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local19.89ms - 20.38ms-unsure 🔍
-2% - +2%
-0.34ms - +0.33ms
preact-main19.92ms - 20.37msunsure 🔍
-2% - +2%
-0.33ms - +0.34ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #4136
  • Commit: 11125b7

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.10ms - 2.24ms-unsure 🔍
-6% - +4%
-0.14ms - +0.09ms
preact-main2.10ms - 2.29msunsure 🔍
-4% - +7%
-0.09ms - +0.14ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.11ms - 1.11ms-unsure 🔍
-0% - +1%
-0.00ms - +0.01ms
preact-main1.11ms - 1.11msunsure 🔍
-1% - +0%
-0.01ms - +0.00ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local33.34ms - 33.87ms-unsure 🔍
-1% - +2%
-0.31ms - +0.52ms
preact-main33.18ms - 33.82msunsure 🔍
-2% - +1%
-0.52ms - +0.31ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local32.93ms - 34.22ms-unsure 🔍
-3% - +2%
-1.07ms - +0.78ms
preact-main33.05ms - 34.37msunsure 🔍
-2% - +3%
-0.78ms - +1.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.48ms - 3.51ms-slower ❌
0% - 1%
0.00ms - 0.03ms
preact-main3.47ms - 3.48msfaster ✔
0% - 1%
0.00ms - 0.03ms
-

tachometer-reporter-action v2 for CI

Copy link

github-actions bot commented Nov 30, 2024

Size Change: -120 B (-0.19%)

Total Size: 62.3 kB

Filename Size Change
dist/preact.js 4.71 kB -18 B (-0.38%)
dist/preact.min.js 4.73 kB -22 B (-0.46%)
dist/preact.min.module.js 4.73 kB -19 B (-0.4%)
dist/preact.min.umd.js 4.75 kB -21 B (-0.44%)
dist/preact.module.js 4.73 kB -19 B (-0.4%)
dist/preact.umd.js 4.77 kB -21 B (-0.44%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 4.13 kB
compat/dist/compat.module.js 4.06 kB
compat/dist/compat.umd.js 4.2 kB
debug/dist/debug.js 3.82 kB
debug/dist/debug.module.js 3.83 kB
debug/dist/debug.umd.js 3.9 kB
devtools/dist/devtools.js 260 B
devtools/dist/devtools.module.js 274 B
devtools/dist/devtools.umd.js 346 B
hooks/dist/hooks.js 1.52 kB
hooks/dist/hooks.module.js 1.56 kB
hooks/dist/hooks.umd.js 1.6 kB
jsx-runtime/dist/jsxRuntime.js 973 B
jsx-runtime/dist/jsxRuntime.module.js 947 B
jsx-runtime/dist/jsxRuntime.umd.js 1.05 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 Nov 30, 2024

Coverage Status

coverage: 99.617%. remained the same
when pulling 11125b7 on reduce-bits
into 42524db on main.

Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me as it's late & my brain has become mush from chasing down TS errors all day, but would this not impact say preact-iso or anyone else who's copy/pasted these values in the past to add behavior?

Edit: That byte reduction is wild, what the hell

@JoviDeCroock
Copy link
Member Author

@rschristian That's a good point, I've switched back SUSPENDED and HYDRATE the others are only present in our internal diff and should not be used externally.

@JoviDeCroock JoviDeCroock merged commit 65b4f6b into main Nov 30, 2024
13 checks passed
@JoviDeCroock JoviDeCroock deleted the reduce-bits branch November 30, 2024 06:47
@JoviDeCroock JoviDeCroock mentioned this pull request Dec 1, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants