async_benchmark library
A Dart package for running and analyzing benchmarks with support for isolated environments and performance tracking.
Classes
-
Benchmark<
S, O> - Abstract class that defines the core structure of a benchmark test.
- BenchmarkProfile
- Represents a profile configuration for benchmarking.
-
BenchmarkResult<
S, O, B extends Benchmark< S, O> > - A structure that contains the results of a benchmark execution.
- BenchmarkRoundResult
- Represents a single round of a Benchmark, including performance details.
Extensions
Functions
-
benchmark<
S, O, B extends Benchmark< (S, O> >B benchmark, {BenchmarkProfile? profile, int? warmup, int? interactions, bool setupOnIsolate = false, Duration? shutdownIsolateDelay, bool verbose = false}) → Future< BenchmarkResult< S, O, B> > - Runs a benchmark with the specified configuration, executing the setup, job, and teardown, and returns the BenchmarkResult including performance details like round duration, Hertz and interaction time.
Typedefs
-
BenchmarkOnIsolateSetup<
S> = ({S setup, Future< void> Function() shutdown}) - Type for setup value and shutting down benchmarks service on an Isolate.
-
BenchmarkSetupResult<
S, O> = ({O? service, S setup}) -
Result type for benchmark setup, consisting of setup data and an optional service.
The
service, if defined, won't be shared between Isolates.