Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/outline.dart |
| diff --git a/pkg/front_end/lib/src/fasta/outline.dart b/pkg/front_end/lib/src/fasta/outline.dart |
| index 1b14e2a565d49b3009debb3f5d0af58a5196b361..a755c1ca00f6821be318bacfbef7b94b4e059189 100644 |
| --- a/pkg/front_end/lib/src/fasta/outline.dart |
| +++ b/pkg/front_end/lib/src/fasta/outline.dart |
| @@ -6,6 +6,8 @@ library fasta.outline; |
| import 'dart:async' show Future; |
| +import 'dart:convert' show JSON; |
| + |
| import 'dart:io' show exitCode; |
| import 'kernel/verifier.dart' show verifyProgram; |
| @@ -24,14 +26,27 @@ import 'ticker.dart' show Ticker; |
| import 'translate_uri.dart' show TranslateUri; |
| +const bool summary = const bool.fromEnvironment("summary", defaultValue: false); |
| const int iterations = const int.fromEnvironment("iterations", defaultValue: 1); |
| compileEntryPoint(List<String> arguments) async { |
| + // Timing results for each iteration |
| + List<double> elapseTimes = <double>[]; |
|
Paul Berry
2017/03/09 16:58:25
Nit: I think you mean "elapsedTimes"
danrubel
2017/03/09 19:05:16
Yes. Fixed.
|
| + |
| for (int i = 0; i < iterations; i++) { |
| if (i > 0) { |
| - print("\n"); |
| + print("\n\n=== Iteration ${i+1} of $iterations"); |
| } |
| + var stopwatch = new Stopwatch()..start(); |
| await compile(arguments); |
| + stopwatch.stop(); |
| + |
| + elapseTimes.add(stopwatch.elapsedMilliseconds.toDouble()); |
| + } |
| + |
| + if (summary) { |
| + var json = JSON.encode(<String, dynamic>{'elapseTimes': elapseTimes}); |
|
Paul Berry
2017/03/09 16:58:25
Here as well (in the string)
danrubel
2017/03/09 19:05:16
Done.
|
| + print('\nSummary: $json'); |
| } |
| } |