BenchmarkService class

微基准测试执行器 / Micro-benchmark runner.

通过多次迭代并统计耗时分布,给出平均值、极值、标准差与每秒操作数 / Runs a task repeatedly and reports the mean, extremes, standard deviation and throughput of the collected samples.

Constructors

BenchmarkService()
构造 BenchmarkService / Creates a BenchmarkService.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run({required String testName, required Future<void> task(int iteration), int iterations = 20, int warmupIterations = 3, void onProgress(int completed, int total)?}) Future<BenchmarkResult>
运行单项基准测试 / Runs a single benchmark.
runSuite({required String suiteName, required Map<String, Future<void> Function(int iteration)> tasks, int iterations = 20, int warmupIterations = 3}) Future<BenchmarkSuiteResult>
顺序运行一组基准测试 / Runs a group of benchmarks sequentially.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited