62750359d9
This is follow-up to 455a105c42
Change-Id: I346e0174dacad4fcae5285b63f77fe217543f7b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211040
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
36 lines
993 B
Dart
36 lines
993 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// @dart=2.9
|
|
|
|
import 'dart:isolate';
|
|
|
|
import 'regexp_benchmark.dart';
|
|
import 'latency.dart';
|
|
|
|
main() async {
|
|
final exitPort = ReceivePort();
|
|
final exitFuture = exitPort.first;
|
|
final isolate = await Isolate.spawn(run, null, onExit: exitPort.sendPort);
|
|
|
|
// Measure event loop latency.
|
|
const tickDuration = const Duration(milliseconds: 1);
|
|
const numberOfTicks = 8 * 1000; // min 8 seconds.
|
|
final EventLoopLatencyStats stats =
|
|
await measureEventLoopLatency(tickDuration, numberOfTicks);
|
|
|
|
// Kill isolate & wait until it's dead.
|
|
isolate.kill(priority: Isolate.immediate);
|
|
await exitFuture;
|
|
|
|
// Report event loop latency statistics.
|
|
stats.report('EventLoopLatencyRegexp');
|
|
}
|
|
|
|
void run(dynamic msg) {
|
|
while (true) {
|
|
RegexpBenchmark().run();
|
|
}
|
|
}
|