commit | eef41aa794a3329b483787ce31a2f600221b556b | [log] [tgz] |
---|---|---|
author | John McCutchan <john@johnmccutchan.com> | Wed Dec 19 08:37:24 2012 -0800 |
committer | John McCutchan <john@johnmccutchan.com> | Wed Dec 19 08:37:24 2012 -0800 |
tree | b880815bfe8d1f42512e05a8ef4cc547ce64feb1 | |
parent | e986045595f0761dc3f07427e3a602f71a87a430 [diff] |
Update DeltaBlue and Richards benchmarks
==========================
The Dart project benchmark harness is the recommended starting point when building a benchmark for Dart.
BenchmarkBase
class that all new benchmarks should extend
1. Add the following to your project's pubspec.yaml
dependencies: benchmark_harness: git: https://github.com/dart-lang/benchmark_harness.git
2. Install pub packages
pub install
3. Add the following import:
import 'package:benchmark_harness/benchmark_harness.dart';
4. Create a benchmark class which inherits from BenchmarkBase
// Import BenchmarkBase class. import 'package:benchmark_harness/benchmark_harness.dart'; // Create a new benchmark by extending BenchmarkBase class TemplateBenchmark extends BenchmarkBase { const TemplateBenchmark() : super("Template"); static void main() { new TemplateBenchmark().report(); } // The benchmark code. void run() { } // Not measured setup code executed prior to the benchmark runs. void setup() { } // Not measures teardown code executed after the benchark runs. void teardown() { } } main() { // Run TemplateBenchmark TemplateBenchmark.main(); }