proposal-signals / signal-polyfill

Implementation tracking the current state of https://github.com/tc39/proposal-signals
Apache License 2.0
185 stars 13 forks source link

Performance benchmark comparison with other reactive TS libs #33

Open transitive-bullshit opened 5 days ago

transitive-bullshit commented 5 days ago

Benchmark Results

Framework average benchmark results Raw results CSV (lower times are better)

These results are from my fork of @milomg's excellent js-reactivity-benchmark, which aggregates signal benchmarks from several libraries together.

I know the signals-polyfill is still a proof-of-concept, but I wanted to create an issue to track relative perf regardless, especially since its relative perf was so poor. I also wanted to double check that the signal-polyfill benchmark adapter by @NullVoxPopuli is correct in terms of comparing with the other libs in a fair, apples-to-apples way.

Lastly, if there are any obvious perf improvements that you notice, please let me know and I'll consider working on them.

Benchmark Notes

Some libs like MobX and Valtio are not included in the average results summary because they fail to run some of the benchmark tests.

None of the benchmark tests use deep reactivity of objects, though many of them do test performance on deep graphs of shallow signals. It would be interesting to compare performance of deeply reactive objects / arrays / Map / Set objects in the future.

These results were last updated September 2024 on an M3 Macbook Pro using Node.js v22.4.1.

transitive-bullshit commented 3 days ago

Updated benchmark after several fixes and adding several new frameworks:

Average benchmark results across frameworks (lower times are better)