[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:
Stephen Adams 2022-02-08 20:24:16 +00:00 committed by Commit Bot
parent d8e2cdaeec
commit f85a44cea6
2 changed files with 10 additions and 2 deletions

View file

@ -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

View file

@ -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