mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
refactor: full generic DIAdapter workflow & universalRegistration abstraction
- Made UniversalChainBenchmark and UniversalChainAsyncBenchmark fully generic with strong typing for DIAdapter<TContainer> - Moved all universalRegistration logic inside adapters; removed global function and typedef - Replaced dynamic/object-based registration with type-safe generic contracts end-to-end - Updated CLI and usage: all DI and scenarios are invoked via type-safe generics - Fixed all analysis errors, Riverpod async/future usages, and imports for full Dart 3 compatibility - All benchmarks fully pass for Cherrypick, GetIt, and Riverpod adapters
This commit is contained in:
@@ -2,10 +2,9 @@ import 'package:benchmark_harness/benchmark_harness.dart';
|
||||
import 'package:benchmark_di/di_adapters/di_adapter.dart';
|
||||
import 'package:benchmark_di/scenarios/universal_chain_module.dart';
|
||||
import 'package:benchmark_di/scenarios/universal_service.dart';
|
||||
import 'package:benchmark_di/scenarios/di_universal_registration.dart';
|
||||
|
||||
class UniversalChainAsyncBenchmark extends AsyncBenchmarkBase {
|
||||
final DIAdapter di;
|
||||
class UniversalChainAsyncBenchmark<TContainer> extends AsyncBenchmarkBase {
|
||||
final DIAdapter<TContainer> di;
|
||||
final int chainCount;
|
||||
final int nestingDepth;
|
||||
final UniversalBindingMode mode;
|
||||
@@ -19,8 +18,7 @@ class UniversalChainAsyncBenchmark extends AsyncBenchmarkBase {
|
||||
|
||||
@override
|
||||
Future<void> setup() async {
|
||||
di.setupDependencies(getUniversalRegistration(
|
||||
di,
|
||||
di.setupDependencies(di.universalRegistration(
|
||||
chainCount: chainCount,
|
||||
nestingDepth: nestingDepth,
|
||||
bindingMode: mode,
|
||||
|
||||
Reference in New Issue
Block a user