Files
cherrypick/benchmark_di/lib/cli/parser.dart

195 lines
6.2 KiB
Dart
Raw Permalink Normal View History

import 'dart:io';
import 'package:args/args.dart';
import 'package:benchmark_di/scenarios/universal_binding_mode.dart';
import 'package:benchmark_di/scenarios/universal_scenario.dart';
/// Enum describing all supported Universal DI benchmark types.
enum UniversalBenchmark {
/// Simple singleton registration benchmark (eager, where supported)
registerSingleton,
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Simple lazy singleton registration benchmark
registerLazySingleton,
/// Chain of eager singleton dependencies
chainSingleton,
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Chain of lazy singleton dependencies
chainLazySingleton,
/// Chain using factories
chainFactory,
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Async chain resolution
chainAsync,
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Named registration benchmark
named,
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Override/child-scope benchmark
override,
}
enum ResolvePhase {
firstResolve,
steadyStateResolve,
}
/// Maps [UniversalBenchmark] to the scenario enum for DI chains.
UniversalScenario toScenario(UniversalBenchmark b) {
switch (b) {
case UniversalBenchmark.registerSingleton:
case UniversalBenchmark.registerLazySingleton:
return UniversalScenario.register;
case UniversalBenchmark.chainSingleton:
case UniversalBenchmark.chainLazySingleton:
return UniversalScenario.chain;
case UniversalBenchmark.chainFactory:
return UniversalScenario.chain;
case UniversalBenchmark.chainAsync:
return UniversalScenario.asyncChain;
case UniversalBenchmark.named:
return UniversalScenario.named;
case UniversalBenchmark.override:
return UniversalScenario.override;
}
}
/// Maps benchmark to registration mode (singleton/lazySingleton/factory/async).
UniversalBindingMode toMode(UniversalBenchmark b) {
switch (b) {
case UniversalBenchmark.registerSingleton:
case UniversalBenchmark.chainSingleton:
case UniversalBenchmark.named:
case UniversalBenchmark.override:
return UniversalBindingMode.singletonStrategy;
case UniversalBenchmark.registerLazySingleton:
case UniversalBenchmark.chainLazySingleton:
return UniversalBindingMode.lazySingletonStrategy;
case UniversalBenchmark.chainFactory:
return UniversalBindingMode.factoryStrategy;
case UniversalBenchmark.chainAsync:
return UniversalBindingMode.asyncStrategy;
}
}
/// Utility to parse a string into its corresponding enum value [T].
T parseEnum<T>(String value, List<T> values, T defaultValue) {
return values.firstWhere(
(v) => v.toString().split('.').last.toLowerCase() == value.toLowerCase(),
orElse: () => defaultValue,
);
}
/// Parses comma-separated integer list from [s].
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
List<int> parseIntList(String s) => s
.split(',')
.map((e) => int.tryParse(e.trim()) ?? 0)
.where((x) => x > 0)
.toList();
/// CLI config describing what and how to benchmark.
class BenchmarkCliConfig {
/// Benchmarks enabled to run (scenarios).
final List<UniversalBenchmark> benchesToRun;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// List of chain counts (parallel, per test).
final List<int> chainCounts;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// List of nesting depths (max chain length, per test).
final List<int> nestDepths;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// How many times to repeat each trial.
final int repeats;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// How many times to warm-up before measuring.
final int warmups;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Output report format.
final String format;
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
/// Name of DI implementation ("cherrypick" or "getit")
final String di;
/// Which resolve phase(s) to measure.
final List<ResolvePhase> phases;
BenchmarkCliConfig({
required this.benchesToRun,
required this.chainCounts,
required this.nestDepths,
required this.repeats,
required this.warmups,
required this.format,
required this.di,
required this.phases,
});
}
/// Parses CLI arguments [args] into a [BenchmarkCliConfig].
/// Supports --benchmark, --chainCount, --nestingDepth, etc.
BenchmarkCliConfig parseBenchmarkCli(List<String> args) {
final parser = ArgParser()
..addOption('benchmark', abbr: 'b', defaultsTo: 'chainSingleton')
..addOption('chainCount', abbr: 'c', defaultsTo: '10')
..addOption('nestingDepth', abbr: 'd', defaultsTo: '5')
..addOption('repeat', abbr: 'r', defaultsTo: '2')
..addOption('warmup', abbr: 'w', defaultsTo: '1')
..addOption('format', abbr: 'f', defaultsTo: 'pretty')
..addOption('resolvePhase',
defaultsTo: 'all', help: 'Resolve phase: first, steady, or all')
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
..addOption('di',
defaultsTo: 'cherrypick',
help: 'DI implementation: cherrypick, getit or riverpod')
..addFlag('help', abbr: 'h', negatable: false, help: 'Show help');
final result = parser.parse(args);
if (result['help'] == true) {
print(parser.usage);
exit(0);
}
final benchNameInput = result['benchmark'] as String;
final isAll = benchNameInput.trim() == 'all';
final allBenches = UniversalBenchmark.values;
String normalizeBenchName(String name) {
final n = name.trim().toLowerCase();
return switch (n) {
'register' || 'registersingleton' || 'registereager' => 'registerSingleton',
'registerlazy' || 'registerlazysingleton' || 'registerlazysingle' => 'registerLazySingleton',
'chain' || 'chainsingleton' || 'chaineager' => 'chainSingleton',
'chainlazy' || 'chainlazysingleton' || 'lazysingleton' => 'chainLazySingleton',
'chainfactory' || 'factory' => 'chainFactory',
'async' || 'asyncchain' || 'chainasync' => 'chainAsync',
'named' => 'named',
'override' => 'override',
_ => n,
};
}
final benchesToRun = isAll
? allBenches
: benchNameInput
.split(',')
.map((n) => parseEnum(normalizeBenchName(n), allBenches,
UniversalBenchmark.chainSingleton))
.toSet()
.toList();
final phaseName = (result['resolvePhase'] as String).toLowerCase();
final phases = switch (phaseName) {
'first' => [ResolvePhase.firstResolve],
'steady' => [ResolvePhase.steadyStateResolve],
_ => ResolvePhase.values,
};
return BenchmarkCliConfig(
benchesToRun: benchesToRun,
chainCounts: parseIntList(result['chainCount'] as String),
nestDepths: parseIntList(result['nestingDepth'] as String),
repeats: int.tryParse(result['repeat'] as String? ?? "") ?? 2,
warmups: int.tryParse(result['warmup'] as String? ?? "") ?? 1,
format: result['format'] as String,
di: result['di'] as String? ?? 'cherrypick',
phases: phases,
);
style: reformat codebase using melos format Applied consistent code formatting across all packages using \$ melos format └> dart format . └> RUNNING (in 8 packages) -------------------------------------------------------------------------------- benchmark_di: Formatted 18 files (0 changed) in 0.30 seconds. benchmark_di: SUCCESS -------------------------------------------------------------------------------- cherrypick: Formatted 24 files (0 changed) in 0.34 seconds. cherrypick: SUCCESS -------------------------------------------------------------------------------- cherrypick_annotations: Formatted 11 files (0 changed) in 0.14 seconds. cherrypick_annotations: SUCCESS -------------------------------------------------------------------------------- cherrypick_flutter: Formatted 3 files (0 changed) in 0.15 seconds. cherrypick_flutter: SUCCESS -------------------------------------------------------------------------------- cherrypick_generator: Formatted 17 files (0 changed) in 0.27 seconds. cherrypick_generator: SUCCESS -------------------------------------------------------------------------------- client_app: Formatted 4 files (0 changed) in 0.14 seconds. client_app: SUCCESS -------------------------------------------------------------------------------- postly: Formatted lib/router/app_router.gr.dart Formatted 23 files (1 changed) in 0.33 seconds. postly: SUCCESS -------------------------------------------------------------------------------- talker_cherrypick_logger: Formatted 4 files (0 changed) in 0.18 seconds. talker_cherrypick_logger: SUCCESS -------------------------------------------------------------------------------- $ melos format └> dart format . └> SUCCESS. No functional or logic changes included.
2025-08-13 15:38:44 +03:00
}