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

Side by Side Diff: pkg/front_end/tool/perf.dart

Issue 2677423002: Small fix to perf.dart. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/front_end/lib/kernel_generator.dart ('k') | pkg/front_end/tool/perf_test.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 /// An entrypoint used to run portions of front_end and measure its performance. 5 /// An entrypoint used to run portions of front_end and measure its performance.
6 library front_end.tool.perf; 6 library front_end.tool.perf;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io' show exit; 9 import 'dart:io' show exit;
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 {bool useSdkSummary: false, bool compileSdk: true}) async { 108 {bool useSdkSummary: false, bool compileSdk: true}) async {
109 // TODO(sigmund): this is here only to compute the input size, 109 // TODO(sigmund): this is here only to compute the input size,
110 // we should extract the input size from the frontend instead. 110 // we should extract the input size from the frontend instead.
111 scanReachableFiles(entryUri); 111 scanReachableFiles(entryUri);
112 112
113 var dartkTimer = new Stopwatch()..start(); 113 var dartkTimer = new Stopwatch()..start();
114 // TODO(sigmund): add a constructor with named args to compiler options. 114 // TODO(sigmund): add a constructor with named args to compiler options.
115 var options = new CompilerOptions() 115 var options = new CompilerOptions()
116 ..strongMode = false 116 ..strongMode = false
117 ..compileSdk = compileSdk 117 ..compileSdk = compileSdk
118 ..packagesFileUri = new Uri.file('.packages') 118 ..packagesFileUri = Uri.base.resolve('.packages')
119 ..onError = ((e) => print('${e.message}')); 119 ..onError = ((e) => print('${e.message}'));
120 if (useSdkSummary) { 120 if (useSdkSummary) {
121 // TODO(sigmund): adjust path based on the benchmark runner architecture. 121 // TODO(sigmund): adjust path based on the benchmark runner architecture.
122 // Possibly let the runner make the file available at an architecture 122 // Possibly let the runner make the file available at an architecture
123 // independent location. 123 // independent location.
124 options.sdkSummary = 124 options.sdkSummary =
125 new Uri.file('out/ReleaseX64/dart-sdk/lib/_internal/spec.sum'); 125 Uri.base.resolve('out/ReleaseX64/dart-sdk/lib/_internal/spec.sum');
126 } else { 126 } else {
127 options.sdkRoot = new Uri.file('sdk'); 127 options.sdkRoot = Uri.base.resolve('sdk');
128 } 128 }
129 Program program = await kernelForProgram(entryUri, options); 129 Program program = await kernelForProgram(entryUri, options);
130 dartkTimer.stop(); 130 dartkTimer.stop();
131 var suffix = useSdkSummary ? '_sum' : ''; 131 var suffix = useSdkSummary ? '_sum' : '';
132 report('kernel_gen_e2e${suffix}', dartkTimer.elapsedMicroseconds); 132 report('kernel_gen_e2e${suffix}', dartkTimer.elapsedMicroseconds);
133 return program; 133 return program;
134 } 134 }
135 135
136 /// Generates unlinkmed summaries for all files in [files], and returns them in 136 /// Generates unlinkmed summaries for all files in [files], and returns them in
137 /// an [_UnlinkedSummaries] container. 137 /// an [_UnlinkedSummaries] container.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 class _Scanner extends Scanner { 340 class _Scanner extends Scanner {
341 _Scanner(String contents) : super(new CharSequenceReader(contents)) { 341 _Scanner(String contents) : super(new CharSequenceReader(contents)) {
342 preserveComments = false; 342 preserveComments = false;
343 } 343 }
344 344
345 @override 345 @override
346 void reportError(errorCode, int offset, List<Object> arguments) { 346 void reportError(errorCode, int offset, List<Object> arguments) {
347 // ignore errors. 347 // ignore errors.
348 } 348 }
349 } 349 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/kernel_generator.dart ('k') | pkg/front_end/tool/perf_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698