RawRecorder class abstract

A recorder for benchmarking raw execution of Dart code.

This is useful for benchmarks that don't need frames or widgets.

Example:

class BenchForLoop extends RawRecorder {
  BenchForLoop() : super(name: benchmarkName);

  static const String benchmarkName = 'for_loop';

  @override
  void body(Profile profile) {
    profile.record('loop', () {
      double x = 0;
      for (int i = 0; i < 10000000; i++) {
        x *= 1.5;
      }
    });
  }
}
Inheritance

Constructors

RawRecorder({required String name})
Creates a raw benchmark recorder with a name.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isTracingEnabled → bool
Whether this recorder requires tracing using Chrome's DevTools Protocol's "Tracing" API.
finalinherited
name → String
The name of the benchmark.
finalinherited
profile → Profile
Returns the recorded profile.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

body(Profile profile) → void
The body of the benchmark.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run() → Future<Profile>
The implementation of the benchmark that will produce a Profile.
override
setUpAll() → Future<void>
Called once before all runs of this benchmark recorder.
inherited
shouldContinue() → bool
Whether the benchmark should continue running.
inherited
tearDownAll() → Future<void>
Called once after all runs of this benchmark recorder.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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