Skip to content

microbench release

microbench 0.5.0

One import, one command, and a rebuilt measurement engine.

  • 💥 [Breaking Changes]
    • Requires Dart 3.0. Value types (Measurement, BenchmarkOptions, Metric, Comparison and its parts, BenchmarkSettings, CellStyle, BenchmarkDiff, BenchmarkChange, SkippedBenchmark) are final.
    • package:microbench/microbench.dart is the only import; suite.dart is merged into it (with package:test, hide one group).
    • runSuite -> runMain. runRegistered and benchmarkColumns are removed: declare a row over several inputs with benchmark(..., column:) in a loop.
    • Removed embedFile, compileAndRun, the microbench:embed and microbench:exe executables, and the exported command-line internals (parseSettings, environmentSettings, runMainUsage, programOptionValues, settingsFromArgs, the runner).
    • BenchmarkOptions is warmup (the minimum), batchTarget (10 ms), samples (40), rounds and duration (a cap for slow benchmarks); minBatch, minSamples and batchSize are removed.
    • Measurement.runtimeMicros is the 10th percentile of the samples, not the median. Measurement.rounds -> Measurement.runs, in JSON too.
    • measureRate and measureDiff show throughput when the benchmark has a size, else the rate; metric overrides it.
    • Arguments after -- reach the program after a --, where runMain stops reading options.
  • ⚙️ [Engine]
    • A comparison's benchmarks are verified before warmup, warm up in turns through one shared timing loop made megamorphic first, and record a fixed number of samples over alternating rounds.
    • On the JIT, identical benchmarks measured up to 23% apart and now agree within 1%. A default run takes 1.5-3 times less time. See guides/how-it-works.md.
  • ✨ [Improvements]
    • Tables warn when a cell's batches vary by more than 10%, and diff warns when the two runs differ in runtime, Dart version or OS.
    • BenchmarkSettings.formats registers a TableRenderer for --format and --out.
    • measureDiff takes alpha; ComparisonGroup takes baseline.
    • parseComparisons throws a FormatException for JSON that is not tables, such as a file saved by 0.4.0, instead of a null-check error.
    • compare, matrix and runComparison in a plain main() read the runner's options.
    • Guides rewritten from beginner to advanced, with a new one on how the engine measures.
  • 🐛 [Fixes]
    • The js target crashed with "self is not defined" on any program that uses a timer, including every suite.
    • An invalid --filter regular expression was ignored instead of exiting with usage.
    • Declarations after an await in a runMain body could run before the body finished.
    • Markdown and HTML cells always show their ratio to the baseline, with 🔶 after it for noise. A ratio that rounded to 1x showed 🌟 instead, and a noise cell showed only ≈.

All posts·RSS feed