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

Switch back to microticks for scheduling #3911

Merged
merged 1 commit into from
Feb 24, 2023
Merged

Conversation

marvinhagemeister
Copy link
Member

This PR replaces the setTimeout scheduling mechanism that was introduced in 10.10.0 with the microtick one that we had before. With us having now access to a much greater variety to Preact and React code bases we identified a couple of scenarios that were broken by the move to setTimeout, like scroll restoration after history navigation. Overall the microtick more closely mirrors what React is doing too, so it's likely better for compat as well.

Our plan is to add an e2e test suite to properly verify those cases and make sure we don't regress on those in the future. But to unblock projects from migrating to a version from before the setTimeout change to the latest version we've decided to move forward with this change before we have our a proper e2e test suite set up.

@github-actions
Copy link

github-actions bot commented Feb 24, 2023

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -3% - +2% (-4.22ms - +2.27ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -5% - +3% (-2.44ms - +1.69ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-5.60ms - +4.00ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -0% - +2% (-0.07ms - +0.59ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -0% - +3% (-0.37ms - +5.48ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - +7% (-0.11ms - +1.77ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -2% - +1% (-0.07ms - +0.03ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -3% - +3% (-2.30ms - +1.93ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    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 🔍 -5% - +4% (-0.63ms - +0.54ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-master
  • todo: slower ❌ 1% - 1% (0.01ms - 0.01ms)
    preact-local vs preact-master

Results

02_replace1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master130.22ms - 135.54ms-unsure 🔍
-2% - +3%
-2.27ms - +4.22ms
unsure 🔍
-1% - +4%
-1.28ms - +5.39ms
preact-local130.04ms - 133.77msunsure 🔍
-3% - +2%
-4.22ms - +2.27ms
-unsure 🔍
-1% - +3%
-1.66ms - +3.83ms
preact-hooks128.81ms - 132.84msunsure 🔍
-4% - +1%
-5.39ms - +1.28ms
unsure 🔍
-3% - +1%
-3.83ms - +1.66ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.39ms - 3.39ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
faster ✔
1% - 1%
0.02ms - 0.03ms
preact-local3.38ms - 3.39msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-faster ✔
1% - 1%
0.02ms - 0.03ms
preact-hooks3.41ms - 3.42msslower ❌
1% - 1%
0.02ms - 0.03ms
slower ❌
1% - 1%
0.02ms - 0.03ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master45.67ms - 47.47ms-unsure 🔍
-4% - +2%
-1.94ms - +0.88ms
unsure 🔍
-5% - +1%
-2.34ms - +0.38ms
preact-local46.02ms - 48.18msunsure 🔍
-2% - +4%
-0.88ms - +1.94ms
-unsure 🔍
-4% - +2%
-1.93ms - +1.04ms
preact-hooks46.53ms - 48.57msunsure 🔍
-1% - +5%
-0.38ms - +2.34ms
unsure 🔍
-2% - +4%
-1.04ms - +1.93ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master68.47ms - 70.84ms-unsure 🔍
-4% - +1%
-2.55ms - +1.00ms
faster ✔
2% - 7%
1.21ms - 4.88ms
preact-local69.11ms - 71.75msunsure 🔍
-1% - +4%
-1.00ms - +2.55ms
-faster ✔
1% - 6%
0.34ms - 4.20ms
preact-hooks71.30ms - 74.10msslower ❌
2% - 7%
1.21ms - 4.88ms
slower ❌
0% - 6%
0.34ms - 4.20ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master48.21ms - 52.30ms-faster ✔
0% - 13%
0.04ms - 6.90ms
unsure 🔍
-8% - +4%
-4.14ms - +2.02ms
preact-local50.98ms - 56.48msunsure 🔍
-0% - +14%
+0.04ms - +6.90ms
-unsure 🔍
-2% - +12%
-1.18ms - +6.00ms
preact-hooks49.01ms - 53.62msunsure 🔍
-4% - +8%
-2.02ms - +4.14ms
unsure 🔍
-11% - +2%
-6.00ms - +1.18ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master58.21ms - 62.61ms-unsure 🔍
-2% - +11%
-0.89ms - +6.30ms
faster ✔
1% - 11%
0.70ms - 7.32ms
preact-local54.86ms - 60.55msunsure 🔍
-10% - +1%
-6.30ms - +0.89ms
-faster ✔
5% - 16%
2.94ms - 10.49ms
preact-hooks61.94ms - 66.90msslower ❌
1% - 12%
0.70ms - 7.32ms
slower ❌
5% - 19%
2.94ms - 10.49ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master62.83ms - 64.94ms-slower ❌
1% - 6%
0.39ms - 3.43ms
unsure 🔍
-5% - -0%
-3.56ms - +0.01ms
preact-local60.89ms - 63.07msfaster ✔
1% - 5%
0.39ms - 3.43ms
-faster ✔
3% - 8%
1.88ms - 5.49ms
preact-hooks64.22ms - 67.10msunsure 🔍
-0% - +6%
-0.01ms - +3.56ms
slower ❌
3% - 9%
1.88ms - 5.49ms
-

run-final

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master39.28ms - 43.77ms-unsure 🔍
-2% - +12%
-0.86ms - +4.79ms
unsure 🔍
-2% - +12%
-0.75ms - +4.87ms
preact-local37.84ms - 41.28msunsure 🔍
-11% - +2%
-4.79ms - +0.86ms
-unsure 🔍
-6% - +6%
-2.31ms - +2.51ms
preact-hooks37.77ms - 41.15msunsure 🔍
-12% - +2%
-4.87ms - +0.75ms
unsure 🔍
-6% - +6%
-2.51ms - +2.31ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master47.04ms - 49.99ms-unsure 🔍
-4% - +5%
-1.69ms - +2.44ms
slower ❌
2% - 10%
0.89ms - 4.50ms
preact-local46.70ms - 49.58msunsure 🔍
-5% - +3%
-2.44ms - +1.69ms
-slower ❌
1% - 9%
0.55ms - 4.10ms
preact-hooks44.78ms - 46.85msfaster ✔
2% - 9%
0.89ms - 4.50ms
faster ✔
1% - 8%
0.55ms - 4.10ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.44ms - 3.45ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
faster ✔
0% - 1%
0.01ms - 0.02ms
preact-local3.44ms - 3.45msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.02ms
preact-hooks3.45ms - 3.46msslower ❌
0% - 1%
0.01ms - 0.02ms
slower ❌
0% - 1%
0.01ms - 0.02ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1308.35ms - 1315.70ms-unsure 🔍
-0% - +0%
-4.00ms - +5.60ms
faster ✔
0% - 1%
1.11ms - 12.06ms
preact-local1308.14ms - 1314.31msunsure 🔍
-0% - +0%
-5.60ms - +4.00ms
-faster ✔
0% - 1%
2.29ms - 12.48ms
preact-hooks1314.56ms - 1322.67msslower ❌
0% - 1%
1.11ms - 12.06ms
slower ❌
0% - 1%
2.29ms - 12.48ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master25.36ms - 25.36ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local25.36ms - 25.36msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks25.38ms - 25.38msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
filter_list

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master23.57ms - 24.00ms-unsure 🔍
-2% - +0%
-0.59ms - +0.07ms
unsure 🔍
-3% - -0%
-0.71ms - +0.00ms
preact-local23.80ms - 24.29msunsure 🔍
-0% - +2%
-0.07ms - +0.59ms
-unsure 🔍
-2% - +1%
-0.46ms - +0.28ms
preact-hooks23.86ms - 24.41msunsure 🔍
-0% - +3%
-0.00ms - +0.71ms
unsure 🔍
-1% - +2%
-0.28ms - +0.46ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.58ms - 1.58ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
faster ✔
1% - 1%
0.02ms - 0.02ms
preact-local1.58ms - 1.58msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-faster ✔
1% - 1%
0.02ms - 0.02ms
preact-hooks1.60ms - 1.60msslower ❌
1% - 1%
0.02ms - 0.02ms
slower ❌
1% - 1%
0.02ms - 0.02ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master175.46ms - 179.51ms-unsure 🔍
-3% - +0%
-5.48ms - +0.37ms
faster ✔
0% - 3%
0.18ms - 6.07ms
preact-local177.93ms - 182.15msunsure 🔍
-0% - +3%
-0.37ms - +5.48ms
-unsure 🔍
-2% - +1%
-3.57ms - +2.43ms
preact-hooks178.48ms - 182.75msslower ❌
0% - 3%
0.18ms - 6.07ms
unsure 🔍
-1% - +2%
-2.43ms - +3.57ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master12.25ms - 13.09ms-unsure 🔍
-4% - +5%
-0.54ms - +0.63ms
unsure 🔍
-6% - +3%
-0.79ms - +0.43ms
preact-local12.22ms - 13.03msunsure 🔍
-5% - +4%
-0.63ms - +0.54ms
-unsure 🔍
-6% - +3%
-0.82ms - +0.38ms
preact-hooks12.41ms - 13.29msunsure 🔍
-3% - +6%
-0.43ms - +0.79ms
unsure 🔍
-3% - +7%
-0.38ms - +0.82ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master26.19ms - 27.41ms-unsure 🔍
-6% - +0%
-1.77ms - +0.11ms
unsure 🔍
-5% - +1%
-1.32ms - +0.36ms
preact-local26.92ms - 28.34msunsure 🔍
-0% - +7%
-0.11ms - +1.77ms
-unsure 🔍
-2% - +5%
-0.56ms - +1.26ms
preact-hooks26.70ms - 27.86msunsure 🔍
-1% - +5%
-0.36ms - +1.32ms
unsure 🔍
-5% - +2%
-1.26ms - +0.56ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master4.62ms - 4.63ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local4.62ms - 4.63msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-faster ✔
0% - 1%
0.02ms - 0.03ms
preact-hooks4.65ms - 4.65msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
slower ❌
0% - 1%
0.02ms - 0.03ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master2.93ms - 3.00ms-unsure 🔍
-1% - +2%
-0.03ms - +0.07ms
faster ✔
4% - 7%
0.11ms - 0.21ms
preact-local2.91ms - 2.98msunsure 🔍
-2% - +1%
-0.07ms - +0.03ms
-faster ✔
4% - 7%
0.13ms - 0.23ms
preact-hooks3.09ms - 3.16msslower ❌
4% - 7%
0.11ms - 0.21ms
slower ❌
4% - 8%
0.13ms - 0.23ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.81ms - 0.81ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
faster ✔
2% - 2%
0.01ms - 0.01ms
preact-local0.81ms - 0.81msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-faster ✔
2% - 2%
0.01ms - 0.01ms
preact-hooks0.82ms - 0.82msslower ❌
2% - 2%
0.01ms - 0.01ms
slower ❌
2% - 2%
0.01ms - 0.01ms
-
todo

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master70.64ms - 73.47ms-unsure 🔍
-3% - +3%
-1.93ms - +2.30ms
unsure 🔍
-3% - +2%
-2.31ms - +1.26ms
preact-local70.30ms - 73.44msunsure 🔍
-3% - +3%
-2.30ms - +1.93ms
-unsure 🔍
-4% - +2%
-2.62ms - +1.21ms
preact-hooks71.49ms - 73.67msunsure 🔍
-2% - +3%
-1.26ms - +2.31ms
unsure 🔍
-2% - +4%
-1.21ms - +2.62ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.06ms - 1.06ms-faster ✔
1% - 1%
0.01ms - 0.01ms
faster ✔
2% - 3%
0.02ms - 0.04ms
preact-local1.07ms - 1.07msslower ❌
1% - 1%
0.01ms - 0.01ms
-faster ✔
1% - 3%
0.02ms - 0.03ms
preact-hooks1.08ms - 1.09msslower ❌
2% - 3%
0.02ms - 0.04ms
slower ❌
1% - 3%
0.02ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

@github-actions
Copy link

Size Change: -138 B (0%)

Total Size: 54.1 kB

Filename Size Change
dist/preact.js 4.21 kB -22 B (0%)
dist/preact.min.js 4.24 kB -23 B (0%)
dist/preact.min.module.js 4.24 kB -23 B (0%)
dist/preact.min.umd.js 4.26 kB -22 B (0%)
dist/preact.module.js 4.23 kB -16 B (0%)
dist/preact.umd.js 4.28 kB -32 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.88 kB 0 B
compat/dist/compat.module.js 3.82 kB 0 B
compat/dist/compat.umd.js 3.95 kB 0 B
debug/dist/debug.js 3 kB 0 B
debug/dist/debug.module.js 3.01 kB 0 B
debug/dist/debug.umd.js 3.08 kB 0 B
devtools/dist/devtools.js 231 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 314 B 0 B
hooks/dist/hooks.js 1.49 kB 0 B
hooks/dist/hooks.module.js 1.52 kB 0 B
hooks/dist/hooks.umd.js 1.57 kB 0 B
jsx-runtime/dist/jsxRuntime.js 360 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 326 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 441 B 0 B
test-utils/dist/testUtils.js 442 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 526 B 0 B

compressed-size-action

@marvinhagemeister marvinhagemeister merged commit 8ff0e53 into master Feb 24, 2023
@marvinhagemeister marvinhagemeister deleted the schedule-promise branch February 24, 2023 12:33
@coveralls
Copy link

coveralls commented Feb 24, 2023

Coverage Status

Coverage: 99.537% (-0.01%) from 99.548% when pulling 54ecaa1 on schedule-promise into 833d7de on master.

JoviDeCroock added a commit that referenced this pull request Jan 14, 2024
JoviDeCroock added a commit that referenced this pull request Jan 16, 2024
* backport #3911

* backport #3906

* backport #3837

* backport #3908

* backport #3904

* backport #3905

* backport #3898

* backport #3910

* backport #3948

* backport #3941

* backport #3945

* backport #3919

* backport #3922

* backport #3921

* backport #3903

* fix lint

* update more

* debug
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