tc39 / proposal-signals

A proposal to add signals to JavaScript.
MIT License
2.87k stars 54 forks source link

Really bad `unwatch` performance (3000%) #215

Open lifeart opened 2 weeks ago

lifeart commented 2 weeks ago

Hello! Thank you for great work and all movements here!

I'm maintainer of https://github.com/lifeart/glimmer-next (glimmer-vm runtime alternative for Ember) Repo using reactive approach very close to signals, based on this reactivity concept: https://github.com/lifeart/glimmer-next/issues/41

I'm trying to be more native and experimenting with drop-in replacement with signals polyfill. During testing I observe 10x performance degradation, especially on cleanup cases:

image

clearManyItems1End phase estimated regression +3750ms [3727ms to 3783ms] OR +3214.31% [3194.71% to 3242.69%]

artifact-1.pdf

here is PR i'm testing on: https://github.com/lifeart/glimmer-next/pull/114

littledan commented 2 weeks ago

Thanks for reporting this! PRs welcome to improve performance.

lifeart commented 2 weeks ago

Linking one more issue: https://github.com/proposal-signals/signal-polyfill/issues/2