async_benchmark 1.2.0
async_benchmark: ^1.2.0 copied to clipboard
A Dart package for running and analyzing benchmarks with support for isolated environments and performance tracking.
1.2.0 #
-
benchmark/BenchmarkExtension.run/IterableBenchmarkExtension.runAll:- Changed: the counts (the profile, default
BenchmarkProfile.normal, with thewarmupandinteractionsoverrides applied) are validated before anything runs, throwing anArgumentErrornaming the invalid field:warmupmust be>= 0,interactions>= 1androunds>= 1. Negative counts used to run nothing silently, androunds: 0maderunAllthrowStateError: No elementafter every benchmark had run.runAllvalidates before its first benchmark; no setup, isolate or report line is started for invalid counts. There is no upper limit: a large count only makes the run longer. - Fixed: the
runAllsummary no longer printsInfinity/NaNspeed ratios when a round is too fast to measure.
- Changed: the counts (the profile, default
-
BenchmarkProfile:- Added
validate(), the check above (the constructor isconst, so it can't check its values).
- Added
-
BenchmarkRoundResult:- Changed:
hertzFormattedandinteractionTimeFormattedprintn/a (too fast to measure)for a zero (or negative) duration andn/a (no interactions)for a round without interactions, instead ofInfinity Hz,NaN Hz,Infinity secor0.000000 µs. - Changed:
hertzis0without interactions (wasNaNwith a zero duration, so such a round compared as the fastest); it staysdouble.infinityfor a zero duration.interactionTimeMsisNaNwithout interactions and0for a zero (or negative) duration. - Added
isMeasurableandspeedRatioFormatted(best)(therunAllspeed ratio, orn/a (...)).
- Changed:
-
BenchmarkResult/MapEntryBenchmarkResultsExtension:- Fixed:
compareToandbestno longer throw for a result without rounds: it sorts after (and loses to) one with rounds.
- Fixed:
-
BenchmarkRoundResultExtension:- Added
bestOrNull(nullwithout rounds;beststill throws).
- Added
-
Tests:
- Validation of every count, through
run,runAllandsetupOnIsolate, before any setup. - The
n/aformats, the speed ratio, and results without rounds.
- Validation of every count, through
1.1.1 #
-
benchmark/BenchmarkExtension.run/IterableBenchmarkExtension.runAll:- Fixed: when a
joborteardownthrows, the benchmark'sshutdownis now called before the error is rethrown, so its resources are released. WithsetupOnIsolate: truethe setupIsolatewas left running and the program never exited. The original error is the one reported, even ifshutdownalso throws.
- Fixed: when a
-
_BenchmarkOnIsolate:- Fixed: the setup
Isolateis stopped even if the caller'sshutdownthrows (the program never exited). - Fixed: a benchmark that can't be sent to an
Isolatenow fails with theIsolate.spawnerror without leaving itsReceivePorts open (the program never exited). - Fixed: a setup value that is a
SendPort(e.g. to reach a service living on the setupIsolate) was mistaken for the isolate's own port, and the benchmark hung forever. The port and the setup value are now sent together.
- Fixed: the setup
-
Tests:
- Edge values of
BenchmarkRoundResult(zero interactions, zero duration, formatting thresholds) and of profiles (zero/negative counts, zero rounds). - The verbose reports of
runandrunAllasserted line by line. - Seeded shuffles, errors in the middle of a run, concurrent runs, and
setupOnIsolatewith a service holding a port on theIsolate. - Integration: an end-to-end verbose
runAlland the error paths ofsetupOnIsolaterun as separate processes, which must exit on their own.
- Edge values of
1.1.0 #
-
_BenchmarkOnIsolate:- Fixed: close the caller's
ReceivePortwhen the setupIsolatestops. A program that ran a benchmark withsetupOnIsolate: truenever exited. - Fixed: an error thrown by
setuporshutdownon theIsolateis now reported as aRemoteErrorinstead of hanging forever.
- Fixed: close the caller's
-
BenchmarkExtension.run:- Added parameter
shutdownIsolateDelay(as inrunAll). - Parameter
verboseis now typed asbool(wasdynamic).
- Added parameter
-
Tests: cover the whole public API and the
setupOnIsolatepath. -
Dart CI:
actions/checkout@v7,codecov/codecov-action@v7; run the tests on the minimum SDK (3.13.0) and on stable. -
sdk: ^3.13.0
-
lints: ^6.1.0
-
test: ^1.33.0
-
dependency_validator: ^5.1.0
1.0.3 #
-
BenchmarkProfile:- Added
copyWith.
- Added
-
test: ^1.25.12
-
dependency_validator: ^4.1.2
1.0.2 #
IterableBenchmarkExtension:runAll: added parametersinteractionDelay,shuffle,shuffleSeed.
1.0.1 #
_BenchmarkOnIsolate:- Added optional field
shutdownIsolateDelay. - Ensure that the
Isolatecloses itsreceivePort.
- Added optional field
1.0.0 #
- Initial version.