bench_press
0.4.2, released 4 weeks ago by kevmoo.com
A statistical multi-runtime benchmarking framework for Dart and Flutter.
What it does
A benchmarking framework that runs tests across VM JIT, Native AOT, WebAssembly, and JavaScript with adaptive warmup, dead code elimination barriers, and Fieller confidence intervals.
AI-written summary of version 0.4.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to measure and compare performance of Dart or Flutter code across multiple runtimes.
- You require statistically rigorous benchmarks with variance decomposition and equivalence testing.
Skip it when
- You are looking for UI widget testing or integration testing tools.
- You need standard unit testing assertions rather than performance benchmarking.
Strengths
- Supports multi-runtime orchestration (JIT, AOT, Wasm, JS).
- Provides statistical rigor with Fieller confidence intervals and adaptive warmup.
- Includes multi-process benchmark capabilities to isolate OS-level variance.
Weaknesses
- Not documented for general app testing or widget assertions.
- Requires careful configuration to minimize OS noise for sub-3% speedups.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Add bench_press to dev_dependencies in pubspec.yaml.
import 'package:bench_press/bench_press.dart';
final class JsonDecodeBenchmark extends Benchmark {
JsonDecodeBenchmark()
: super('json_decode', config: const BenchmarkConfig(trials: 16));
@override
void run() {
Blackhole.consume(42);
}
}
void main(List<String> args) => mainBenchmark(JsonDecodeBenchmark(), args);Works with
Packages commonly used together with bench_press: ones it builds on, ones built on it, and its own family.
- yamlbench_press depends on itA Dart library for parsing YAML documents into Dart data structures.
- stack_tracebench_press depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- iobench_press depends on itUtilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.
- source_spanbench_press depends on itStandard representation for source code locations, spans, and human-friendly error messages.
- argsbench_press depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.