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,Comparisonand its parts,BenchmarkSettings,CellStyle,BenchmarkDiff,BenchmarkChange,SkippedBenchmark) arefinal. package:microbench/microbench.dartis the only import;suite.dartis merged into it (withpackage:test, hide onegroup).runSuite->runMain.runRegisteredandbenchmarkColumnsare removed: declare a row over several inputs withbenchmark(..., column:)in a loop.- Removed
embedFile,compileAndRun, themicrobench:embedandmicrobench:exeexecutables, and the exported command-line internals (parseSettings,environmentSettings,runMainUsage,programOptionValues,settingsFromArgs, the runner). BenchmarkOptionsiswarmup(the minimum),batchTarget(10 ms),samples(40),roundsandduration(a cap for slow benchmarks);minBatch,minSamplesandbatchSizeare removed.Measurement.runtimeMicrosis the 10th percentile of the samples, not the median.Measurement.rounds->Measurement.runs, in JSON too.measureRateandmeasureDiffshow throughput when the benchmark has asize, else the rate;metricoverrides it.- Arguments after
--reach the program after a--, whererunMainstops reading options.
- Requires Dart 3.0. Value types (
- ⚙️ [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
diffwarns when the two runs differ in runtime, Dart version or OS. BenchmarkSettings.formatsregisters aTableRendererfor--formatand--out.measureDifftakesalpha;ComparisonGrouptakesbaseline.parseComparisonsthrows aFormatExceptionfor JSON that is not tables, such as a file saved by 0.4.0, instead of a null-check error.compare,matrixandrunComparisonin a plainmain()read the runner's options.- Guides rewritten from beginner to advanced, with a new one on how the engine measures.
- Tables warn when a cell's batches vary by more than 10%, and
- 🐛 [Fixes]
- The
jstarget crashed with "self is not defined" on any program that uses a timer, including every suite. - An invalid
--filterregular expression was ignored instead of exiting with usage. - Declarations after an
awaitin arunMainbody 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
1xshowed 🌟 instead, and a noise cell showed only≈.
- The