Add complex DI benchmarks, main runner, and English README with summarized results for cherrypick core

This commit is contained in:
Sergey Penkovsky
2025-08-01 08:26:33 +03:00
parent 2c1f9d5969
commit 23683119c2
9 changed files with 389 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:cherrypick/cherrypick.dart';
class AppModule extends Module {
@override
void builder(Scope currentScope) {
bind<FooService>().toProvide(() => FooService());
}
}
// Dummy service for DI
class FooService {}
class RegisterAndResolveBenchmark extends BenchmarkBase {
RegisterAndResolveBenchmark() : super('RegisterAndResolve');
late final Scope scope;
@override
void setup() {
scope = CherryPick.openRootScope();
scope.installModules([AppModule()]);
}
@override
void run() {
scope.resolve<FooService>();
}
@override
void teardown() => CherryPick.closeRootScope();
}
void main() {
RegisterAndResolveBenchmark().report();
}