-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Potential @vue/reactivity bug discovered during benchmark stress tests #11928
Comments
Seems like a regression from the 3.5 refactor. 3.4 works fine in this case. |
I can confirm that https://github.com/vuejs/core/releases/tag/v3.5.6 fixes this issue. 🎉 It also provides a solid perf improvement across all Before
After
Note that the Thanks for the quick turnaround @yyx990803 🙏 |
Vue version
@vue/reactivity
latest v3.5.5Note that this issue does not use any other Vue packages but rather only relies on
@vue/reactivity
directly.Link to minimal reproduction
https://github.com/transitive-bullshit/js-reactivity-benchmark/tree/feature/minimal-issues-repro-vue-reactivity
Steps to reproduce
feature/minimal-issues-repro-vue-reactivity
branchpnpm install
pnpm test
to make sure everything's working locallypnpm bench
to reproduce the issueWhen you run the benchmark, the
@vue/reactivity
adapter will hang on this line.All other benchmark tests work fine, so I've removed them from this branch. The benchmark stress test is pretty simple. It is adapted from the unit tests in cellx. It creates a series of
N
layers, each containing 4computed
properties depending on the previous layer's signal values. It then performs a read from the last layer and makes sure that the value matches the expected value.@vue/reactivity
is the only framework to fail this particular test, and what makes me even more sure that this may be a bug in Vue is that if I remove these 4effect
lines, then the benchmark tests seem to run fine.What is expected?
The benchmark test should run fine, with each one completing in a few seconds at most.
What is actually happening?
The benchmark test for
@vue/reactivity
hangs as described above.System Info
Any additional comments?
I discovered this issue while deep-diving on a comparison of the most popular, standalone TS reactivity libs.
During my deep-dive, I wanted to benchmark all of them and created a fork of @milomg's excellent js-reactivity-benchmark, which includes dozens of benchmarks and stress tests.
I'll also note that
@vue/reactivity
also hangs on the largest dynamic stress test, which I have commented out insrc/index.ts
at the moment to focus on the simplercellx
stress test.Given that
@vue/reactivity
is the only framework to encounter an issue running thecellx
benchmark, I figure it could either be a rare bug in@vue/reactivity
or a bug in my benchmark adapter. If you see anything that could be improved with the@vue/reactivity
adapter for these benchmarks, please let me know.Thanks! 🙏
The text was updated successfully, but these errors were encountered: