Jin Profile picture
Jin
Борец с массовой деградацией

Nov 28, 2022, 7 tweets

🔥 Big Benchmark of State Managers 🔥
perf.js.hyoo.ru/#!bench=9h2as6…

Perfect State Manager should:
- Batch changes
- Collapse doubled dependencies
- Reuse moved dependencies
- Skip eval which result isn't needed
- Skip eval when dependencies isn't changed
- Eval dependents only when actually changed
- Apply side effects only once on state change

@mweststrate #mobx is too wasteful of memory. I think this is the reason why it is not very fast. You can steal this idea to dramatically reduce the number of memory allocations:
mol.hyoo.ru/#!section=arti…

@mweststrate @LegendAppHQ Your marketing information (legendapp.com/open-source/) is untrue:

1. Reactivity model causes side effects an unpredictable number of times: eval.js.hyoo.ru/#!code=let%20r…

2. If you turn off the tests, your solution shows the worst performance.

@BenLesh @_ojkwon @ncjamieson #rxjs causes heavy handlers and side-effects many times over due to the complex dependency graph, which leads to significant performance degradation. Is it possible to solve this problem without adding asynchrony point via debounce(0) to each stream?

@zero__bias @_sergeysova @sashahoroshih #effector promises maximum performance. However, in this test it recalculates the entire graph per event. This gives one of the worst results. Twice as bad as even Redux+Reselect, which suffer from the same problem.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling