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

fix case where strict equality leads to a deadlock with c._force #3906

Merged
merged 3 commits into from
Feb 21, 2023

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Feb 20, 2023

In a rare case where async context providers get updated we could reach a deadlock scenario with c._force https://codesandbox.io/s/amazing-sunset-unlmgg?file=/src/useSubmitHook.ts

@github-actions
Copy link

github-actions bot commented Feb 20, 2023

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: slower ❌ 0% - 4% (0.23ms - 5.70ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -4% - +4% (-1.52ms - +1.55ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +1% (-3.61ms - +12.69ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -2% - +1% (-0.37ms - +0.24ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -1% - +1% (-0.99ms - +1.36ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -3% - +4% (-1.08ms - +1.29ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -2% - +5% (-0.08ms - +0.17ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -1% - +1% (-0.80ms - +0.45ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -3% - +1% (-0.10ms - +0.04ms)
    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 🔍 -3% - +1% (-0.55ms - +0.14ms)
    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
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master128.22ms - 131.61ms-faster ✔
0% - 4%
0.23ms - 5.70ms
faster ✔
0% - 5%
0.35ms - 6.13ms
preact-local130.73ms - 135.03msslower ❌
0% - 4%
0.23ms - 5.70ms
-unsure 🔍
-3% - +2%
-3.46ms - +2.90ms
preact-hooks130.82ms - 135.50msslower ❌
0% - 5%
0.35ms - 6.13ms
unsure 🔍
-2% - +3%
-2.90ms - +3.46ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.35ms - 3.49ms-unsure 🔍
-1% - +3%
-0.04ms - +0.10ms
unsure 🔍
-7% - +2%
-0.27ms - +0.07ms
preact-local3.38ms - 3.39msunsure 🔍
-3% - +1%
-0.10ms - +0.04ms
-unsure 🔍
-8% - +1%
-0.29ms - +0.03ms
preact-hooks3.36ms - 3.67msunsure 🔍
-2% - +8%
-0.07ms - +0.27ms
unsure 🔍
-1% - +8%
-0.03ms - +0.29ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master46.20ms - 47.93ms-unsure 🔍
-2% - +3%
-0.93ms - +1.23ms
unsure 🔍
-3% - +1%
-1.59ms - +0.66ms
preact-local46.26ms - 47.57msunsure 🔍
-3% - +2%
-1.23ms - +0.93ms
-unsure 🔍
-3% - +1%
-1.59ms - +0.36ms
preact-hooks46.80ms - 48.25msunsure 🔍
-1% - +3%
-0.66ms - +1.59ms
unsure 🔍
-1% - +3%
-0.36ms - +1.59ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master68.90ms - 71.16ms-unsure 🔍
-1% - +4%
-0.70ms - +2.94ms
unsure 🔍
-3% - +2%
-1.91ms - +1.06ms
preact-local67.47ms - 70.33msunsure 🔍
-4% - +1%
-2.94ms - +0.70ms
-unsure 🔍
-5% - +0%
-3.27ms - +0.18ms
preact-hooks69.48ms - 71.41msunsure 🔍
-2% - +3%
-1.06ms - +1.91ms
unsure 🔍
-0% - +5%
-0.18ms - +3.27ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master48.22ms - 52.18ms-unsure 🔍
-6% - +5%
-3.05ms - +2.74ms
unsure 🔍
-8% - +4%
-4.25ms - +2.01ms
preact-local48.23ms - 52.47msunsure 🔍
-5% - +6%
-2.74ms - +3.05ms
-unsure 🔍
-8% - +4%
-4.19ms - +2.26ms
preact-hooks48.89ms - 53.75msunsure 🔍
-4% - +9%
-2.01ms - +4.25ms
unsure 🔍
-5% - +8%
-2.26ms - +4.19ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master57.70ms - 62.16ms-unsure 🔍
-5% - +6%
-2.99ms - +3.58ms
faster ✔
2% - 12%
0.88ms - 7.57ms
preact-local57.22ms - 62.05msunsure 🔍
-6% - +5%
-3.58ms - +2.99ms
-faster ✔
2% - 12%
1.05ms - 7.99ms
preact-hooks61.66ms - 66.65msslower ❌
1% - 13%
0.88ms - 7.57ms
slower ❌
2% - 14%
1.05ms - 7.99ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master62.38ms - 64.35ms-unsure 🔍
-2% - +4%
-1.21ms - +2.49ms
unsure 🔍
-2% - +3%
-0.95ms - +1.86ms
preact-local61.16ms - 64.29msunsure 🔍
-4% - +2%
-2.49ms - +1.21ms
-unsure 🔍
-3% - +3%
-2.05ms - +1.67ms
preact-hooks61.91ms - 63.91msunsure 🔍
-3% - +1%
-1.86ms - +0.95ms
unsure 🔍
-3% - +3%
-1.67ms - +2.05ms
-

run-final

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master36.36ms - 39.30ms-faster ✔
1% - 13%
0.45ms - 5.35ms
faster ✔
5% - 16%
1.81ms - 6.75ms
preact-local38.77ms - 42.69msslower ❌
1% - 14%
0.45ms - 5.35ms
-unsure 🔍
-10% - +3%
-4.16ms - +1.40ms
preact-hooks40.13ms - 44.09msslower ❌
5% - 18%
1.81ms - 6.75ms
unsure 🔍
-4% - +10%
-1.40ms - +4.16ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master39.75ms - 42.05ms-unsure 🔍
-4% - +4%
-1.55ms - +1.52ms
unsure 🔍
-3% - +5%
-1.12ms - +2.07ms
preact-local39.90ms - 41.94msunsure 🔍
-4% - +4%
-1.52ms - +1.55ms
-unsure 🔍
-3% - +5%
-1.02ms - +2.00ms
preact-hooks39.32ms - 41.54msunsure 🔍
-5% - +3%
-2.07ms - +1.12ms
unsure 🔍
-5% - +2%
-2.00ms - +1.02ms
-

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.46ms - 3.47msslower ❌
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-master1351.52ms - 1361.64ms-unsure 🔍
-1% - +0%
-12.69ms - +3.61ms
unsure 🔍
-1% - +0%
-10.13ms - +3.76ms
preact-local1354.73ms - 1367.51msunsure 🔍
-0% - +1%
-3.61ms - +12.69ms
-unsure 🔍
-0% - +1%
-6.61ms - +9.32ms
preact-hooks1355.01ms - 1364.52msunsure 🔍
-0% - +1%
-3.76ms - +10.13ms
unsure 🔍
-1% - +0%
-9.32ms - +6.61ms
-

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-master21.75ms - 22.27ms-unsure 🔍
-1% - +2%
-0.24ms - +0.37ms
unsure 🔍
-2% - +1%
-0.45ms - +0.26ms
preact-local21.79ms - 22.10msunsure 🔍
-2% - +1%
-0.37ms - +0.24ms
-unsure 🔍
-2% - +1%
-0.45ms - +0.12ms
preact-hooks21.87ms - 22.35msunsure 🔍
-1% - +2%
-0.26ms - +0.45ms
unsure 🔍
-1% - +2%
-0.12ms - +0.45ms
-

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-master109.93ms - 111.67ms-unsure 🔍
-1% - +1%
-1.36ms - +0.99ms
unsure 🔍
-2% - +0%
-1.95ms - +0.42ms
preact-local110.20ms - 111.77msunsure 🔍
-1% - +1%
-0.99ms - +1.36ms
-unsure 🔍
-2% - +0%
-1.71ms - +0.55ms
preact-hooks110.76ms - 112.37msunsure 🔍
-0% - +2%
-0.42ms - +1.95ms
unsure 🔍
-0% - +2%
-0.55ms - +1.71ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master16.15ms - 16.64ms-unsure 🔍
-1% - +3%
-0.14ms - +0.55ms
slower ❌
4% - 11%
0.66ms - 1.68ms
preact-local15.95ms - 16.43msunsure 🔍
-3% - +1%
-0.55ms - +0.14ms
-slower ❌
3% - 10%
0.45ms - 1.47ms
preact-hooks14.78ms - 15.67msfaster ✔
4% - 10%
0.66ms - 1.68ms
faster ✔
3% - 9%
0.45ms - 1.47ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master36.23ms - 37.80ms-unsure 🔍
-3% - +3%
-1.29ms - +1.08ms
unsure 🔍
-2% - +5%
-0.59ms - +1.65ms
preact-local36.23ms - 38.01msunsure 🔍
-3% - +4%
-1.08ms - +1.29ms
-unsure 🔍
-2% - +5%
-0.56ms - +1.83ms
preact-hooks35.68ms - 37.29msunsure 🔍
-4% - +2%
-1.65ms - +0.59ms
unsure 🔍
-5% - +1%
-1.83ms - +0.56ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master4.62ms - 4.63ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local4.63ms - 4.63msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks4.65ms - 4.65msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.51ms - 3.68ms-unsure 🔍
-5% - +2%
-0.17ms - +0.08ms
faster ✔
4% - 11%
0.14ms - 0.44ms
preact-local3.55ms - 3.73msunsure 🔍
-2% - +5%
-0.08ms - +0.17ms
-faster ✔
3% - 10%
0.10ms - 0.40ms
preact-hooks3.77ms - 4.01msslower ❌
4% - 12%
0.14ms - 0.44ms
slower ❌
3% - 11%
0.10ms - 0.40ms
-

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.83msslower ❌
2% - 2%
0.01ms - 0.01ms
slower ❌
2% - 2%
0.01ms - 0.01ms
-
todo

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master54.51ms - 55.55ms-unsure 🔍
-1% - +1%
-0.45ms - +0.80ms
faster ✔
2% - 5%
0.84ms - 2.64ms
preact-local54.50ms - 55.21msunsure 🔍
-1% - +1%
-0.80ms - +0.45ms
-faster ✔
2% - 5%
1.10ms - 2.73ms
preact-hooks56.04ms - 57.50msslower ❌
2% - 5%
0.84ms - 2.64ms
slower ❌
2% - 5%
1.10ms - 2.73ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.06ms - 1.06ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
2% - 2%
0.02ms - 0.02ms
preact-local1.06ms - 1.06msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
2% - 2%
0.02ms - 0.02ms
preact-hooks1.08ms - 1.08msslower ❌
2% - 2%
0.02ms - 0.02ms
slower ❌
2% - 2%
0.02ms - 0.02ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

coveralls commented Feb 20, 2023

Coverage Status

Coverage: 99.548%. Remained the same when pulling 9c1fa01 on strict-equality-fix into 17ce063 on master.

@github-actions
Copy link

github-actions bot commented Feb 20, 2023

Size Change: +3 B (0%)

Total Size: 54.2 kB

Filename Size Change
dist/preact.js 4.24 kB +1 B
dist/preact.min.js 4.26 kB +1 B
dist/preact.umd.js 4.31 kB +1 B
ℹ️ 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
dist/preact.min.module.js 4.26 kB 0 B
dist/preact.min.umd.js 4.29 kB 0 B
dist/preact.module.js 4.25 kB 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

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Fantastic work on narrowing it down to a test case 🙌

@JoviDeCroock JoviDeCroock merged commit 3bfce88 into master Feb 21, 2023
@JoviDeCroock JoviDeCroock deleted the strict-equality-fix branch February 21, 2023 10:36
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.

None yet

3 participants