mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
[benchmarks] Add noise to BigIntPrintParse fake results
Change-Id: I1cce5d8066255b489fd4c51395462183cac9728f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227362 Reviewed-by: Jonas Termansen <sortie@google.com> Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
parent
d8e2cdaeec
commit
f85a44cea6
|
@ -4,6 +4,8 @@
|
|||
|
||||
// ignore_for_file: avoid_function_literals_in_foreach_calls
|
||||
|
||||
import 'dart:math' show Random;
|
||||
|
||||
import 'package:benchmark_harness/benchmark_harness.dart';
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
|
||||
|
@ -240,7 +242,9 @@ class FormatJsBigIntBenchmark extends Benchmark {
|
|||
class DummyBenchmark extends BenchmarkBase {
|
||||
DummyBenchmark(String name) : super(name);
|
||||
@override
|
||||
double measure() => 2000 * 1000 * 1.0; // A rate of one run per 2s.
|
||||
// A rate of one run per 2s, with a millisecond of noise. Some variation is
|
||||
// needed for Golem's noise-based filtering and regression detection.
|
||||
double measure() => (2000 + Random().nextDouble() - 0.5) * 1000;
|
||||
}
|
||||
|
||||
/// Create [ParseJsBigIntBenchmark], or a dummy benchmark if JavaScript BigInt
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
// @dart=2.9
|
||||
|
||||
import 'dart:math' show Random;
|
||||
|
||||
import 'package:benchmark_harness/benchmark_harness.dart';
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
|
||||
|
@ -242,7 +244,9 @@ class FormatJsBigIntBenchmark extends Benchmark {
|
|||
class DummyBenchmark extends BenchmarkBase {
|
||||
DummyBenchmark(String name) : super(name);
|
||||
@override
|
||||
double measure() => 2000 * 1000 * 1.0; // A rate of one run per 2s.
|
||||
// A rate of one run per 2s, with a millisecond of noise. Some variation is
|
||||
// needed for Golem's noise-based filtering and regression detection.
|
||||
double measure() => (2000 + Random().nextDouble() - 0.5) * 1000;
|
||||
}
|
||||
|
||||
/// Create [ParseJsBigIntBenchmark], or a dummy benchmark if JavaScript BigInt
|
||||
|
|
Loading…
Reference in a new issue