reactivity_benchmark 0.0.1

SDKdartflutter
Platformandroidioswindowslinuxmacosweb

Benchmark comparing different standalone Dart reactivity/signals frameworks.

Dart Reactivity Benchmark Pub Version

Benchmark comparing different standalone Dart reactivity/signals frameworks.

Score Ranking

RankFrameworkScoreTotal TimeFail Coefficients
🥇alien_signals31.291.90s0.0
🥈preact_signals21.055.04s0.0
🥉signals20.916.78s0.0
4state_beacon15.321.79s8.0
5mobx6.0213.61s0.0
6solidart4.2619.66s3.0

[!TIP]

Ranking algorithm

  1. The score of the test with the shortest test time is 1.0, and the score of the other frameworks is the time of the same test divided by the shortest time. For example, if the shortest time is 100ms and the time of other frameworks is 200ms, the scores of the others are 0.5
  2. If the test case status is fail, the score is 0
  3. If the test case status contains sun and count, and both count and sum are pass, the score is calculated as 1 algorithm. If only one of them is fail, the score is divided by 2, and if all fail, the score is 0
  4. The total score of each framework is the sum of the total scores of all test cases.

Benchmark results of each framework

Test Casepreact_signalsmobxalien_signalssolidartsignalsstate_beacon
avoidablePropagation100.69ms1.15s82.56ms1.08s94.06ms88.32ms (fail)
broadPropagation210.82ms2.12s169.81ms2.55s209.22ms2.88ms (fail)
deepPropagation94.72ms769.94ms68.38ms976.44ms92.47ms90.16ms (fail)
diamond150.29ms1.15s98.64ms1.66s145.39ms85.13ms (fail)
mux186.06ms888.39ms177.49ms960.85ms190.57ms95.40ms (fail)
repeatedObservers21.14ms112.72ms10.40ms102.51ms23.46ms24.13ms (fail)
triangle56.02ms385.69ms43.12ms548.71ms53.19ms41.01ms (fail)
unstable33.60ms160.43ms21.31ms161.48ms40.98ms180.74ms (fail)
molBench275.97ms323.41ms272.07ms953.76ms275.89ms428μs
create_signals2.10ms22.98ms8.96ms16.81ms12.93ms29.81ms
comp_0to17.58ms19.17ms2.21ms23.53ms4.92ms24.18ms
comp_1to13.73ms19.20ms7.44ms22.16ms7.09ms23.41ms
comp_2to15.63ms9.50ms6.55ms13.50ms3.24ms14.35ms
comp_4to16.59ms9.00ms10.20ms6.76ms3.76ms7.92ms
comp_1000to12μs10μs1μs2.70ms3μs19μs
comp_1to27.30ms17.98ms4.43ms14.65ms5.09ms20.67ms
comp_1to418.32ms8.29ms4.84ms11.70ms7.59ms19.33ms
comp_1to83.33ms9.88ms2.29ms10.53ms4.33ms19.43ms
comp_1to10002.46ms7.56ms1.61ms9.38ms1.98ms18.21ms
update_1to13.96ms9.47ms1.69ms18.43ms4.13ms2.80ms
update_2to11.95ms4.68ms856μs8.99ms2.04ms1.29ms
update_4to11.01ms2.43ms474μs4.45ms1.08ms700μs
update_1000to110μs22μs6μs52μs12μs6μs
update_1to22.04ms4.60ms868μs9.46ms2.17ms1.31ms
update_1to4978μs2.38ms442μs4.42ms1.05ms665μs
update_1to100025μs81μs21μs112μs25μs174μs
cellx10004.62ms36.61ms3.94ms75.38ms4.19ms3.09ms
cellx250013.52ms118.75ms9.90ms218.96ms11.62ms10.54ms
cellx500037.58ms258.82ms25.31ms484.05ms33.81ms30.55ms
10x5 - 2 sources - read 20.0% (simple)222.67ms1.02s134.39ms1.32s (half)244.38ms139.71ms
10x10 - 6 sources - dynamic - read 20.0% (dynamic)114.98ms831.18ms91.30ms1.24s (half)120.02ms100.96ms
1000x12 - 4 sources - dynamic (large)1.79s855.72ms141.99ms2.08s (half)2.53s191.51ms
1000x5 - 25 sources (wide dense)1.33s1.85s233.06ms2.67s (half)2.29s248.53ms
5x500 - 3 sources (deep)108.83ms582.66ms119.97ms998.89ms (half)110.59ms124.99ms
100x15 - 6 sources - dynamic (very dynamic)214.71ms849.96ms142.26ms1.40s (half)253.74ms142.89ms

[!TIP]

  • (fail): Test case failed
  • (half): Half of the test cases failed

Integrate into your project

You can easily integrate Dart reactivity benchmark into your project to provide benchmarking.

Install it

dart pub add dev:reactivity_benchmark

Writing Tests

class YourReactiveFramework extends ReactiveFramework {
  ...
}

void main() {
  final framework = YourReactiveFramework();
  runFrameworkBench(framework);
}

Local run benchmarks

Dart VM

dart run frameworks/[framework_name].dart

Run all benchamrks

bash bench.sh