Skip to content

Commit

Permalink
fix: rank table total time
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Dec 22, 2024
1 parent e45ca10 commit af9b447
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ bash bench.sh
<!-- Rank Table -->
| Rank | Framework | Score | Total Time |
|---|---|---|---|
| 🥇 | [alien_signals](https://pub.dev/packages/alien_signals) | 29.49 | | 3.8809s
| 🥈 | [preact_signals](https://pub.dev/packages/preact_signals) | 23.62 | | 8.9111s
| 🥉 | [signals](https://pub.dev/packages/signals) | 22.46 | | 11.3242s
| 4 | [state_beacon](https://pub.dev/packages/state_beacon) | 16.11 | | 3.5473s
| 5 | [mobx](https://pub.dev/packages/mobx) | 6.36 | | 26.9648s
| 6 | [solidart](https://pub.dev/packages/solidart) | 4.17 | | 39.7314s
| 🥇 | [alien_signals](https://pub.dev/packages/alien_signals) | 29.49 | 3.88s |
| 🥈 | [preact_signals](https://pub.dev/packages/preact_signals) | 23.62 | 8.91s |
| 🥉 | [signals](https://pub.dev/packages/signals) | 22.46 | 11.32s |
| 4 | [state_beacon](https://pub.dev/packages/state_beacon) | 16.11 | 3.55s |
| 5 | [mobx](https://pub.dev/packages/mobx) | 6.36 | 26.96s |
| 6 | [solidart](https://pub.dev/packages/solidart) | 4.17 | 39.73s |
<!-- Rank Table End -->

> [!TIP]
Expand All @@ -40,15 +40,15 @@ bash bench.sh
<!-- Benchmark Table -->
| Test Case | preact_signals | mobx | alien_signals | solidart | signals | state_beacon |
|---|---|---|---|---|---|---|
| kairo avoidablePropagation | 200.17ms | 2.3350s | 201.70ms | 2.2026s | 207.61ms | 178.07ms (fail) |
| kairo broadPropagation | 419.02ms | 4.2668s | 390.04ms | 5.3634s | 470.32ms | 7.21ms (fail) |
| kairo deepPropagation | 145.62ms | 1.5243s | 151.75ms | 1.9878s | 171.87ms | 141.39ms (fail) |
| kairo diamond | 266.20ms | 2.4075s | 234.45ms | 3.4263s | 289.45ms | 196.37ms (fail) |
| kairo mux | 383.30ms | 1.7811s | 388.38ms | 2.0296s | 405.58ms | 191.00ms (fail) |
| kairo avoidablePropagation | 200.17ms | 2.33s | 201.70ms | 2.20s | 207.61ms | 178.07ms (fail) |
| kairo broadPropagation | 419.02ms | 4.27s | 390.04ms | 5.36s | 470.32ms | 7.21ms (fail) |
| kairo deepPropagation | 145.62ms | 1.52s | 151.75ms | 1.99s | 171.87ms | 141.39ms (fail) |
| kairo diamond | 266.20ms | 2.41s | 234.45ms | 3.43s | 289.45ms | 196.37ms (fail) |
| kairo mux | 383.30ms | 1.78s | 388.38ms | 2.03s | 405.58ms | 191.00ms (fail) |
| kairo repeatedObservers | 40.06ms | 234.88ms | 21.94ms | 211.29ms | 44.97ms | 54.12ms (fail) |
| kairo triangle | 96.96ms | 771.05ms | 92.45ms | 1.1206s | 101.97ms | 82.44ms (fail) |
| kairo triangle | 96.96ms | 771.05ms | 92.45ms | 1.12s | 101.97ms | 82.44ms (fail) |
| kairo unstable | 68.29ms | 348.31ms | 42.66ms | 354.03ms | 77.72ms | 342.06ms (fail) |
| molBench | 490.12ms | 589.55ms | 482.76ms | 1.7048s | 486.09ms | 1.13ms |
| molBench | 490.12ms | 589.55ms | 482.76ms | 1.70s | 486.09ms | 1.13ms |
| create_signals | 4.52ms | 69.56ms | 25.41ms | 70.89ms | 30.94ms | 72.78ms |
| comp_0to1 | 16.39ms | 17.99ms | 4.50ms | 40.64ms | 11.40ms | 53.19ms |
| comp_1to1 | 26.00ms | 30.94ms | 18.36ms | 46.52ms | 15.86ms | 52.62ms |
Expand All @@ -68,13 +68,13 @@ bash bench.sh
| update_1to1000 | 56μs | 159μs | 59μs | 226μs | 45μs | 415μs |
| cellx1000 | 9.28ms | 68.01ms | 8.00ms | 155.89ms | 9.69ms | 5.38ms |
| cellx2500 | 26.73ms | 222.71ms | 21.90ms | 485.80ms | 31.21ms | 19.95ms |
| cellx5000 | 69.48ms | 535.08ms | 46.79ms | 1.1125s | 63.81ms | 58.10ms |
| 10x5 - 2 sources - read 20.0% (simple) | 406.42ms | 1.9917s | 260.97ms | 2.6385s (half) | 511.96ms | 262.19ms |
| 10x10 - 6 sources - dynamic - read 20.0% (dynamic) | 255.88ms | 1.5063s | 198.26ms | 2.4091s (half) | 285.03ms | 217.33ms |
| 1000x12 - 4 sources - dynamic (large) | 2.7891s | 1.7601s | 275.43ms | 4.3157s (half) | 3.8013s | 340.40ms |
| 1000x5 - 25 sources (wide dense) | 2.4544s | 3.5288s | 460.14ms | 5.0712s (half) | 3.5199s | 521.65ms |
| 5x500 - 3 sources (deep) | 203.24ms | 1.1102s | 222.78ms | 1.9708s (half) | 227.61ms | 235.26ms |
| 100x15 - 6 sources - dynamic (very dynamic) | 439.11ms | 1.6744s | 256.72ms | 2.7645s (half) | 473.96ms | 266.88ms |
| cellx5000 | 69.48ms | 535.08ms | 46.79ms | 1.11s | 63.81ms | 58.10ms |
| 10x5 - 2 sources - read 20.0% (simple) | 406.42ms | 1.99s | 260.97ms | 2.64s (half) | 511.96ms | 262.19ms |
| 10x10 - 6 sources - dynamic - read 20.0% (dynamic) | 255.88ms | 1.51s | 198.26ms | 2.41s (half) | 285.03ms | 217.33ms |
| 1000x12 - 4 sources - dynamic (large) | 2.79s | 1.76s | 275.43ms | 4.32s (half) | 3.80s | 340.40ms |
| 1000x5 - 25 sources (wide dense) | 2.45s | 3.53s | 460.14ms | 5.07s (half) | 3.52s | 521.65ms |
| 5x500 - 3 sources (deep) | 203.24ms | 1.11s | 222.78ms | 1.97s (half) | 227.61ms | 235.26ms |
| 100x15 - 6 sources - dynamic (very dynamic) | 439.11ms | 1.67s | 256.72ms | 2.76s (half) | 473.96ms | 266.88ms |
<!-- Benchmark Table End -->

> [!TIP]
Expand Down
12 changes: 9 additions & 3 deletions gen_bench_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ Future<void> main() async {
final frameworkLink = 'https://pub.dev/packages/$framework';
final displayFramework = '[$framework]($frameworkLink)';

rankTable.writeln(
'| $displayRank | $displayFramework | ${score.toStringAsFixed(2)} | | ${formatMicroseconds(time)}');
rankTable.write('| ');
rankTable.writeAll([
displayRank,
displayFramework,
score.toStringAsFixed(2),
formatMicroseconds(time)
], ' | ');
rankTable.writeln(' |');
}

final rankStart = readmeContent.indexOf('<!-- Rank Table -->') + 20;
Expand Down Expand Up @@ -146,7 +152,7 @@ String formatMicroseconds(int microseconds) {
return '${(microseconds / 1000).toStringAsFixed(2)}ms';
}

return '${(microseconds / 1000000).toStringAsFixed(4)}s';
return '${(microseconds / 1000000).toStringAsFixed(2)}s';
}

String trimTestCaseName(String name) {
Expand Down

0 comments on commit af9b447

Please sign in to comment.