mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:29:48 +00:00
Tweaks to the analysis server benchmarks.
BUG= R=brianwilkerson@google.com, scheglov@google.com Review-Url: https://codereview.chromium.org/2998813002 .
This commit is contained in:
parent
222ce73a49
commit
a714187898
|
@ -18,7 +18,7 @@ import 'perf/benchmarks_impl.dart';
|
|||
Future main(List<String> args) async {
|
||||
final List<Benchmark> benchmarks = [
|
||||
new ColdAnalysisBenchmark(),
|
||||
new AnalysisBenchmark(),
|
||||
new AnalysisBenchmark()
|
||||
];
|
||||
|
||||
CommandRunner runner = new CommandRunner(
|
||||
|
@ -115,10 +115,7 @@ class RunCommand extends Command {
|
|||
|
||||
time.stop();
|
||||
print('Finished in ${time.elapsed.inSeconds} seconds.\n');
|
||||
Map m = {
|
||||
'benchmark': benchmarkId,
|
||||
'result': result.toJson(),
|
||||
};
|
||||
Map m = {'benchmark': benchmarkId, 'result': result.toJson()};
|
||||
print(JSON.encode(m));
|
||||
} catch (error, st) {
|
||||
print('$benchmarkId threw exception: $error');
|
||||
|
@ -133,7 +130,7 @@ abstract class Benchmark {
|
|||
final String description;
|
||||
final bool enabled;
|
||||
|
||||
/// One of 'memory' or 'cpu'.
|
||||
/// One of 'memory', 'cpu', or 'group'.
|
||||
final String kind;
|
||||
|
||||
Benchmark(this.id, this.description, {this.enabled: true, this.kind: 'cpu'});
|
||||
|
|
|
@ -18,16 +18,18 @@ import 'memory_tests.dart';
|
|||
class ColdAnalysisBenchmark extends Benchmark {
|
||||
ColdAnalysisBenchmark()
|
||||
: super(
|
||||
'analysis-server-cold',
|
||||
'Analysis server benchmarks of a large project on start-up, no '
|
||||
'existing driver cache.',
|
||||
);
|
||||
'analysis-server-cold',
|
||||
'Analysis server benchmarks of a large project on start-up, no '
|
||||
'existing driver cache.',
|
||||
kind: 'group');
|
||||
|
||||
int get maxIterations => 3;
|
||||
|
||||
@override
|
||||
Future<BenchMarkResult> run({bool quick: false}) async {
|
||||
deleteServerCache();
|
||||
if (!quick) {
|
||||
deleteServerCache();
|
||||
}
|
||||
|
||||
Stopwatch stopwatch = new Stopwatch()..start();
|
||||
|
||||
|
@ -59,10 +61,10 @@ class ColdAnalysisBenchmark extends Benchmark {
|
|||
class AnalysisBenchmark extends Benchmark {
|
||||
AnalysisBenchmark()
|
||||
: super(
|
||||
'analysis-server',
|
||||
'Analysis server benchmarks of a large project, with an existing '
|
||||
'driver cache.',
|
||||
);
|
||||
'analysis-server',
|
||||
'Analysis server benchmarks of a large project, with an existing '
|
||||
'driver cache.',
|
||||
kind: 'group');
|
||||
|
||||
@override
|
||||
Future<BenchMarkResult> run({bool quick: false}) async {
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
To see a list of all available benchmarks, run:
|
||||
|
||||
```
|
||||
dart benchmarks/benchmarks.dart list
|
||||
dart benchmark/benchmarks.dart list
|
||||
```
|
||||
|
||||
To run an individual benchmark, run:
|
||||
|
||||
```
|
||||
dart benchmarks/benchmarks.dart run <benchmark-id>
|
||||
dart benchmark/benchmarks.dart run <benchmark-id>
|
||||
```
|
||||
|
||||
## How they're tested
|
||||
|
@ -27,11 +27,9 @@ See `test/benchmark_test.dart`.
|
|||
|
||||
## To add a new benchmark
|
||||
|
||||
Register the new benchmark in then main() method of benchmarks/benchmarks.dart.
|
||||
Register the new benchmark in the `main()` method of benchmark/benchmarks.dart.
|
||||
|
||||
## On the bots
|
||||
|
||||
Our benchmarks run on a continuous performance testing system. It will run
|
||||
any benchmark produced by the `benchmarks/benchmarks.dart list` command.
|
||||
|
||||
To not run a benchmark on the bot, define the benchmark with the `disable` flag.
|
||||
Our benchmarks run on a continuous performance testing system. Currently, the
|
||||
benchmarks need to be manually registered ahead of time.
|
||||
|
|
Loading…
Reference in a new issue