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

implement state settling in X #3553

Merged
merged 3 commits into from
Jun 5, 2022
Merged

implement state settling in X #3553

merged 3 commits into from
Jun 5, 2022

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Jun 3, 2022

Supersedes #3522
Mirrors #3440 from Preact 11

This introduces state settling like React in Preact, this is something some libraries rely on to have states settle after a given amount of renders.

Codesandbox as illustration https://codesandbox.io/s/young-cdn-jof35q?file=/src/index.js

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -2% - +3% (-3.23ms - +4.55ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -4% - +1% (-1.99ms - +0.67ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -1% - +3% (-20.48ms - +40.70ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -13% - +9% (-8.44ms - +6.07ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -2% - +3% (-3.79ms - +4.70ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -13% - +3% (-13.81ms - +3.15ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -1% - +5% (-0.03ms - +0.13ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.02ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 +0% - +0% (+0.01ms - +0.01ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -0% - +0% (-0.02ms - +0.02ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master142.38ms - 147.62ms-unsure 🔍
-3% - +2%
-4.55ms - +3.23ms
preact-local142.79ms - 148.54msunsure 🔍
-2% - +3%
-3.23ms - +4.55ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.75ms - 3.76ms-unsure 🔍
-0% - +0%
-0.02ms - +0.01ms
preact-local3.75ms - 3.77msunsure 🔍
-0% - +0%
-0.01ms - +0.02ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master46.22ms - 47.26ms-unsure 🔍
-1% - +2%
-0.60ms - +0.97ms
preact-local45.97ms - 47.14msunsure 🔍
-2% - +1%
-0.97ms - +0.60ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master74.62ms - 78.91ms-unsure 🔍
-3% - +4%
-2.64ms - +3.05ms
preact-local74.69ms - 78.43msunsure 🔍
-4% - +3%
-3.05ms - +2.64ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master54.05ms - 57.49ms-faster ✔
1% - 10%
0.29ms - 5.91ms
preact-local56.64ms - 61.10msslower ❌
0% - 11%
0.29ms - 5.91ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master63.73ms - 68.67ms-unsure 🔍
-1% - +11%
-0.70ms - +6.83ms
preact-local60.29ms - 65.99msunsure 🔍
-10% - +1%
-6.83ms - +0.70ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master117.13ms - 129.26ms-unsure 🔍
-7% - +7%
-8.88ms - +9.05ms
preact-local116.52ms - 129.70msunsure 🔍
-7% - +7%
-9.05ms - +8.88ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master43.01ms - 45.60ms-unsure 🔍
-2% - +6%
-1.01ms - +2.41ms
preact-local42.49ms - 44.72msunsure 🔍
-5% - +2%
-2.41ms - +1.01ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-local
preact-master45.85ms - 47.75ms-unsure 🔍
-1% - +4%
-0.67ms - +1.99ms
preact-local45.20ms - 47.08msunsure 🔍
-4% - +1%
-1.99ms - +0.67ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.64ms - 3.64ms-unsure 🔍
-0% - -0%
-0.01ms - -0.01ms
preact-local3.65ms - 3.65msunsure 🔍
+0% - +0%
+0.01ms - +0.01ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1405.21ms - 1440.82ms-unsure 🔍
-3% - +1%
-40.70ms - +20.48ms
preact-local1408.25ms - 1458.00msunsure 🔍
-1% - +3%
-20.48ms - +40.70ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master25.58ms - 25.59ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-local25.59ms - 25.59msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-
filter_list

duration

VersionAvg timevs preact-mastervs preact-local
preact-master58.61ms - 68.65ms-unsure 🔍
-10% - +14%
-6.07ms - +8.44ms
preact-local57.20ms - 67.69msunsure 🔍
-13% - +9%
-8.44ms - +6.07ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.81ms - 1.81ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-local1.81ms - 1.81msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master179.04ms - 185.61ms-unsure 🔍
-3% - +2%
-4.70ms - +3.79ms
preact-local180.10ms - 185.48msunsure 🔍
-2% - +3%
-3.79ms - +4.70ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.40ms - 6.42ms-unsure 🔍
-0% - +0%
-0.02ms - +0.02ms
preact-local6.40ms - 6.43msunsure 🔍
-0% - +0%
-0.02ms - +0.02ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-local
preact-master98.26ms - 111.23ms-unsure 🔍
-3% - +14%
-3.15ms - +13.81ms
preact-local93.96ms - 104.88msunsure 🔍
-13% - +3%
-13.81ms - +3.15ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.87ms - 4.87ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-local4.87ms - 4.87msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-local
preact-master2.63ms - 2.75ms-unsure 🔍
-5% - +1%
-0.13ms - +0.03ms
preact-local2.69ms - 2.79msunsure 🔍
-1% - +5%
-0.03ms - +0.13ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.04ms - 1.04ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-local1.04ms - 1.04msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

coveralls commented Jun 3, 2022

Coverage Status

Coverage increased (+0.004%) to 99.444% when pulling daa65de on state-settling-x into 8fb48b8 on master.

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Size Change: +309 B (0%)

Total Size: 42.7 kB

Filename Size Change
dist/preact.js 4.03 kB +49 B (1%)
dist/preact.min.js 4.06 kB +51 B (1%)
dist/preact.module.js 4.05 kB +53 B (1%)
dist/preact.umd.js 4.1 kB +52 B (1%)
hooks/dist/hooks.js 1.2 kB +33 B (2%)
hooks/dist/hooks.module.js 1.22 kB +37 B (3%)
hooks/dist/hooks.umd.js 1.28 kB +34 B (2%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.46 kB 0 B
compat/dist/compat.module.js 3.44 kB 0 B
compat/dist/compat.umd.js 3.51 kB 0 B
debug/dist/debug.js 3.01 kB 0 B
debug/dist/debug.module.js 3 kB 0 B
debug/dist/debug.umd.js 3.09 kB 0 B
devtools/dist/devtools.js 232 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 308 B 0 B
jsx-runtime/dist/jsxRuntime.js 317 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 327 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 395 B 0 B
test-utils/dist/testUtils.js 444 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 521 B 0 B

compressed-size-action

Copy link
Member

@developit developit left a comment

Choose a reason for hiding this comment

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

Let's get this landed!

@developit developit merged commit 1dc4f56 into master Jun 5, 2022
@developit developit deleted the state-settling-x branch June 5, 2022 21:11
This was referenced Jun 14, 2022
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