Skip to content
pubscout

bench_press

0.4.2, released 4 weeks ago by kevmoo.com

A statistical multi-runtime benchmarking framework for Dart and Flutter.

$ flutter pub add bench_press
Source repository

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.