dart-sdk/benchmarks/EventLoopLatencyRegexp/dart/regexp_benchmark.dart
Alexander Aprelev 455a105c42 [vm/benchmark] Introduce benchmarks that measures event loop latency for regexp processing.
This captures performance issues reported on https://github.com/flutter/flutter/issues/88063

Change-Id: Ie216808a02231be7915c60268718f3e0a0dc3c99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210282
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-08-16 18:41:49 +00:00

15 lines
411 B
Dart

// Copyright (c) 2021, 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.
import 'dart:math';
import 'dart:convert';
class RegexpBenchmark {
void run() {
final re = RegExp(r'(x+)*y');
final s = 'x' * 26 + '';
re.allMatches(s).iterator.moveNext();
}
}