Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1150)

Unified Diff: pkg/front_end/lib/src/fasta/outline.dart

Issue 2739963002: cleanup and improve A/B fasta test harness (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/tool/fasta/abcompile.dart » ('j') | pkg/front_end/tool/fasta/abcompile.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
}
}
« no previous file with comments | « no previous file | pkg/front_end/tool/fasta/abcompile.dart » ('j') | pkg/front_end/tool/fasta/abcompile.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698