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

Side by Side Diff: pkg/front_end/lib/src/fasta/outline.dart

Issue 2739963002: cleanup and improve A/B fasta test harness (Closed)
Patch Set: address comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/tool/fasta/abcompile.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.outline; 5 library fasta.outline;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:convert' show JSON;
10
9 import 'dart:io' show exitCode; 11 import 'dart:io' show exitCode;
10 12
11 import 'kernel/verifier.dart' show verifyProgram; 13 import 'kernel/verifier.dart' show verifyProgram;
12 14
13 import 'compiler_command_line.dart' show CompilerCommandLine; 15 import 'compiler_command_line.dart' show CompilerCommandLine;
14 16
15 import 'compiler_context.dart' show CompilerContext; 17 import 'compiler_context.dart' show CompilerContext;
16 18
17 import 'errors.dart' show InputError, inputError; 19 import 'errors.dart' show InputError, inputError;
18 20
19 import 'kernel/kernel_target.dart' show KernelTarget; 21 import 'kernel/kernel_target.dart' show KernelTarget;
20 22
21 import 'dill/dill_target.dart' show DillTarget; 23 import 'dill/dill_target.dart' show DillTarget;
22 24
23 import 'ticker.dart' show Ticker; 25 import 'ticker.dart' show Ticker;
24 26
25 import 'translate_uri.dart' show TranslateUri; 27 import 'translate_uri.dart' show TranslateUri;
26 28
29 const bool summary = const bool.fromEnvironment("summary", defaultValue: false);
27 const int iterations = const int.fromEnvironment("iterations", defaultValue: 1); 30 const int iterations = const int.fromEnvironment("iterations", defaultValue: 1);
28 31
29 compileEntryPoint(List<String> arguments) async { 32 compileEntryPoint(List<String> arguments) async {
33 // Timing results for each iteration
34 List<double> elapsedTimes = <double>[];
35
30 for (int i = 0; i < iterations; i++) { 36 for (int i = 0; i < iterations; i++) {
31 if (i > 0) { 37 if (i > 0) {
32 print("\n"); 38 print("\n\n=== Iteration ${i+1} of $iterations");
33 } 39 }
40 var stopwatch = new Stopwatch()..start();
34 await compile(arguments); 41 await compile(arguments);
42 stopwatch.stop();
43
44 elapsedTimes.add(stopwatch.elapsedMilliseconds.toDouble());
45 }
46
47 if (summary) {
48 var json = JSON.encode(<String, dynamic>{'elapsedTimes': elapsedTimes});
49 print('\nSummary: $json');
35 } 50 }
36 } 51 }
37 52
38 outlineEntryPoint(List<String> arguments) async { 53 outlineEntryPoint(List<String> arguments) async {
39 for (int i = 0; i < iterations; i++) { 54 for (int i = 0; i < iterations; i++) {
40 if (i > 0) { 55 if (i > 0) {
41 print("\n"); 56 print("\n");
42 } 57 }
43 await outline(arguments); 58 await outline(arguments);
44 } 59 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 exitCode = 1; 148 exitCode = 1;
134 print("Verification of program failed: $e"); 149 print("Verification of program failed: $e");
135 if (s != null && c.options.verbose) { 150 if (s != null && c.options.verbose) {
136 print(s); 151 print(s);
137 } 152 }
138 } 153 }
139 } 154 }
140 return uri; 155 return uri;
141 } 156 }
142 } 157 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/tool/fasta/abcompile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698