chore: fix current status, all implemented features and refactors

This commit is contained in:
Sergey Penkovsky
2025-08-06 22:35:49 +03:00
parent ea39b9d0e1
commit 3da71674d4
3 changed files with 46 additions and 3 deletions

View File

@@ -89,6 +89,17 @@ class MyBenchmark extends BenchmarkBase with BenchmarkWithScope {
---
| Benchmark | Chain Count | Depth | Mean (us) | Median | Stddev | Min | Max | N | ΔRSS(KB) | ΔPeak(KB) | PeakRSS(KB) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| RegisterSingleton | 10 | 5 | 24 | 45 | 22 | 2 | 45 | 2 | 0 | 0 | 199232 |
| ChainSingleton | 10 | 5 | 41 | 45 | 4 | 37 | 45 | 2 | 0 | 0 | 199296 |
| ChainFactory | 10 | 5 | 43 | 50 | 8 | 35 | 50 | 2 | 0 | 0 | 199296 |
| AsyncChain | 10 | 5 | 49 | 50 | 2 | 47 | 50 | 2 | 0 | 0 | 199344 |
| Named | 10 | 5 | 1 | 1 | 0 | 1 | 1 | 2 | 0 | 0 | 199344 |
| Override | 10 | 5 | 2 | 2 | 1 | 1 | 2 | 2 | 0 | 0 | 199360 |
---
## Лицензия
MIT

View File

@@ -1,5 +1,7 @@
import 'dart:math';
import 'package:benchmark_cherrypick/cli/report/markdown_report.dart';
import '../scenarios/universal_chain_module.dart';
import 'report/pretty_report.dart';
import 'report/csv_report.dart';
@@ -70,6 +72,7 @@ class BenchmarkCliRunner {
'pretty': PrettyReport(),
'csv': CsvReport(),
'json': JsonReport(),
'markdown': MarkdownReport(),
};
print(reportGenerators[config.format]?.render(results) ?? PrettyReport().render(results));
}

View File

@@ -6,10 +6,39 @@ class PrettyReport extends ReportGenerator {
'benchmark','chainCount','nestingDepth','mean_us','median_us','stddev_us',
'min_us','max_us','trials','memory_diff_kb','delta_peak_kb','peak_rss_kb'
];
static const nameMap = {
'Universal_UniversalBenchmark.registerSingleton': 'RegisterSingleton',
'Universal_UniversalBenchmark.chainSingleton': 'ChainSingleton',
'Universal_UniversalBenchmark.chainFactory': 'ChainFactory',
'Universal_UniversalBenchmark.chainAsync': 'AsyncChain',
'Universal_UniversalBenchmark.named': 'Named',
'Universal_UniversalBenchmark.override': 'Override',
};
@override
String render(List<Map<String, dynamic>> rows) {
final header = keys.join('\t');
final lines = rows.map((r) => keys.map((k) => (r[k] ?? '').toString()).join('\t')).toList();
final headers = [
'Benchmark', 'Chain Count', 'Depth', 'Mean (us)', 'Median', 'Stddev', 'Min', 'Max', 'N', 'ΔRSS(KB)', 'ΔPeak(KB)', 'PeakRSS(KB)'
];
final header = headers.join('\t');
final lines = rows.map((r) {
final readableName = nameMap[r['benchmark']] ?? r['benchmark'];
return [
readableName,
r['chainCount'],
r['nestingDepth'],
r['mean_us'],
r['median_us'],
r['stddev_us'],
r['min_us'],
r['max_us'],
r['trials'],
r['memory_diff_kb'],
r['delta_peak_kb'],
r['peak_rss_kb'],
].join('\t');
}).toList();
return ([header] + lines).join('\n');
}
}
}