perf(reactivity): ports alien-signals 0.4.4#12349
Conversation
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-sfc
@vue/compiler-dom
@vue/compiler-ssr
@vue/runtime-core
@vue/reactivity
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
❌ Deploy Preview for vue-sfc-playground failed. Why did it fail? →
|
|
/ecosystem-ci run |
|
/ecosystem-ci run |
alien-signalsalien-signals 0.4.4
|
📝 Ran ecosystem CI: Open
|
This reverts commit 69468ca.
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
PR is now based on alien-signals 0.4.4, due to the implementation of some new fast paths (e.g. stackblitz/alien-signals#7), which gets more performance improvements compared to 0.3.2. Benchmark result (baseline is f15e9d7): |
|
Guys, you are doing it wrong. Your microbenchmarks are executed on unrealistic cases. As a result, you are sharpening your implementations for benchmarks, which in real applications leads to performance degradation. In particular, both the I added this library to Big State Managers Benchmark and, as expected, when emulating a complex application, the "fastest library" turned out to be very slow. A detailed explanation of this benchmark is here: https://page.hyoo.ru/#!=3ia3ll_rcpl7b |
|
Hi @nin-jin 👋, I don't know how to use the website so can't test it, but this problem we think needs to be avoided by developers, #9497 is the PR for this. In fact, alien-signals has an equalityComputed API under the unstable namespace that can return the results you expect and you can take a try. But anyway, this is not the right place to discuss. If you have more questions, please open an issue at https://github.com/stackblitz/alien-signals/issues, thanks. |
PR vuejs#12349 marked these tests as todo. They are actually working now.
PR #12349 marked these tests as todo. They are actually working now.

alien-signals(https://github.com/stackblitz/alien-signals) is a research-oriented signal library rewritten based on Vue 3.4's reactivity system. It sets several constraints to ensure the high-performance implementation of a reactivity system. (Currently, it is the fastest implementation among all signal libraries)This PR ports the https://github.com/stackblitz/alien-signals/blob/master/src/system.ts code to https://github.com/vuejs/core/blob/main/packages/reactivity/src/effect.ts to leverage all the optimizations discovered by
alien-signals.Benefits
Benchmark Results
computed
effect
ref
Potential Improvements
MergingCompleted when update to alien-signals 0.4.4dirtyLevel,canPropagate,pauseLevel, andallowRecurseinto one attribute should further reduce memory usage. Reaching the lowest memory usage is not the purpose of this PR, so we will not implement it here currently.