Skip to content

microbench changelog

  • Breaking Changes: Measurement.runtimeMicros is the 10th percentile of the samples, not the median. Interference only ever slows a batch, so the low end repeats across runs (0.06% spread against 0.14% for the median). bestMicros, worstMicros, meanMicros, cv and the samples are unchanged.
  • Breaking Changes: BenchmarkOptions.warmup is the least warmup time; it now lasts until the per-call time stops improving, since a fixed warmup can end while the JIT is still speeding the code up, which made two runs of one benchmark differ by a percent or more.
  • Breaking Changes: batching follows the run’s length: a run slower than batchTarget is measured one per batch, and a batch too fast to time grows until it is measurable.
  • Breaking Changes: duration is now the longest time spent measuring. The exercise phase stops as soon as the low end has settled for BenchmarkOptions.minSamples batches (new, default 40), so a run usually finishes well before it: --standard on a small benchmark dropped from about 2.1 s to 0.3-1.5 s with the same answer. Raise minSamples to always spend the full duration.
  • BenchmarkSettings.formats names a TableRenderer, so --format=NAME and --out=FILE.NAME reach a custom renderer in runMain.
  • compare, matrix and runComparison in a plain void main() pick up the runner’s options (--quick, --filter, --format, --verify).
  • benchmarkColumns(name, {column: run}, sizes: [...]) declares one row measured in several columns, in a suite.
  • test_integration/: a public-API smoke test, run on the VM and on node.
  • Pass benchmark options directly to the runner, for example dart run microbench --quick --filter=UTF8. Use -- to forward custom arguments to benchmark programs.
  • When the runner finds no benchmarks, it shows a starter file and the command to run it.
  • Filtered comparisons keep each group’s original baseline, including when reloaded from a saved report. Filtering out the baseline hides its ratios.
  • microbench diff distinguishes labels containing / and reports an error if two cells have the same title, group, row, and column.
  • parseComparisons accepts indented JSON reports as well as compact JSON and JSON Lines.
  • measureAll runs every open session’s teardown, even if one throws, and preserves the first failure and its stack trace.
  • If a benchmark process fails to start, the runner continues with the remaining programs and targets and exits with a failure status.
  • A benchmark whose batches outlast the whole duration (runs of seconds) now sits out the remaining rounds, as before rounds existed, instead of running at least one batch in every round.
  • Breaking Changes: dart run microbench with no command now runs the benchmarks under benchmark/ instead of printing usage (exit code 64), and a first word that is not a command is taken as a path; runMain keeps settings from an enclosing BenchmarkSettings.apply that its arguments do not override.
  • runSuite(args, body): command-line options for benchmarks declared with benchmark() and group().
  • Benchmarks declared in a plain void main() read options from the MICROBENCH_ARGS environment variable, which dart run microbench now sets, so dart run microbench <file> -- --quick works without runSuite.
  • runMain takes any setting its arguments leave out from an enclosing BenchmarkSettings.apply.
  • Warmup no longer runs for tens of seconds when a run is shorter than a clock tick: it is timed on one running stopwatch instead of a sum of per-run readings that rounded to 0.
  • dart run microbench runs benchmarks without the run command name, which stays as an alias.
  • Breaking Changes: text tables mark noise with (≈ same) and end with warnings; Markdown and HTML cells may end with ≈; Measurement JSON gains sampleMicros; comparisons measure their rows in alternating rounds, so timings shift slightly from 0.1.0.
  • compare and matrix: comparison tables from maps of closures, sync or async.
  • package:microbench/suite.dart: benchmark() and group(), declared like package:test and run automatically.
  • runMain(args, body): --quick, --thorough, --filter, --format, --out, --verify, --save, --baseline and --threshold for any benchmark program, through zone-scoped BenchmarkSettings.
  • Rows of a column are measured in alternating rounds (A B B A); BenchmarkOptions.rounds and BenchmarkOptions.thorough. measureAll measures a list of benchmarks this way.
  • Significance: Measurement keeps its samples (sampleMicros, meanMicros, stdDevMicros, cv); cells whose difference fails a Mann-Whitney U test (mannWhitneyP, runComparison(alpha:)) are marked ≈, also in measureDiff.
  • Warnings below tables for runs under 1 ns and times that do not grow with the input size (Comparison.warnings, showWarnings:).
  • verify: on compare, matrix, runComparison, measureAll and measureDiff checks that rows return equal results (deepEquals), throwing OutputMismatchError.
  • JsonTableRenderer, Comparison.fromJson, parseComparisons, Metric.byName, and BenchmarkDiff with ChangeKind for regression checks.
  • Tables record their environment (detectRuntime(), currentEnvironment()).
  • dart run microbench run compiles and runs benchmarks on jit, aot, js and wasm (runBenchmarks, planRun, findBenchmarks), and dart run microbench diff compares saved results.
  • Guides: getting trustworthy numbers, and migrating from benchmark_harness.
  • Bars no longer fail when a run is faster than the clock resolution, and infinite values format as Infinity.
  • Initial release, extracted from the benchmark harness shared by hashlib, cipherlib and convertlib.
  • SyncBenchmark, AsyncBenchmark and SkippedBenchmark, with SyncBenchmark.from and AsyncBenchmark.from for closures.
  • BenchmarkOptions for warmup, duration and batch sizing.
  • Measurement with median, best, worst and median absolute deviation, and JSON support.
  • Metric.throughput, Metric.rate, Metric.runtime and Metric.perSecond.
  • runComparison and Comparison, rendered by MarkdownTableRenderer, HtmlTableRenderer and TextTableRenderer, or serialized with toJson.
  • package:microbench/io.dart: ReportFile, embedFile, compileAndRun and environmentSummary.
  • Executables microbench:embed and microbench:exe.