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

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

Issue 2918623004: Use backend targets to run Kernel transformations in Fasta (Closed)
Patch Set: Adjust to the recent changes in master Created 3 years, 6 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/test/fasta/testing/suite.dart ('k') | pkg/kernel/lib/target/flutter.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 fasta and measure its performance. 5 /// An entrypoint used to run portions of fasta and measure its performance.
6 library front_end.tool.fasta_perf; 6 library front_end.tool.fasta_perf;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // Invoke the fasta kernel generator for the program starting in [entryUri] 207 // Invoke the fasta kernel generator for the program starting in [entryUri]
208 // TODO(sigmund): update to use the frontend api once fasta is being hit. 208 // TODO(sigmund): update to use the frontend api once fasta is being hit.
209 generateKernel(Uri entryUri, 209 generateKernel(Uri entryUri,
210 {bool compileSdk: true, bool strongMode: false}) async { 210 {bool compileSdk: true, bool strongMode: false}) async {
211 // TODO(sigmund): this is here only to compute the input size, 211 // TODO(sigmund): this is here only to compute the input size,
212 // we should extract the input size from the frontend instead. 212 // we should extract the input size from the frontend instead.
213 scanReachableFiles(entryUri); 213 scanReachableFiles(entryUri);
214 214
215 var timer = new Stopwatch()..start(); 215 var timer = new Stopwatch()..start();
216 final Ticker ticker = new Ticker(); 216 final Ticker ticker = new Ticker();
217 final DillTarget dillTarget = new DillTarget(ticker, uriResolver, "vm"); 217 final DillTarget dillTarget = new DillTarget(ticker, uriResolver, "vm_fasta");
218 final KernelTarget kernelTarget = new KernelTarget( 218 final KernelTarget kernelTarget = new KernelTarget(
219 PhysicalFileSystem.instance, dillTarget, uriResolver, strongMode); 219 PhysicalFileSystem.instance, dillTarget, uriResolver, strongMode);
220 var entrypoints = [ 220 var entrypoints = [
221 entryUri, 221 entryUri,
222 // These extra libraries are added to match the same set of libraries 222 // These extra libraries are added to match the same set of libraries
223 // scanned by default by the VM and the other benchmarks. 223 // scanned by default by the VM and the other benchmarks.
224 Uri.parse('dart:async'), 224 Uri.parse('dart:async'),
225 Uri.parse('dart:collection'), 225 Uri.parse('dart:collection'),
226 Uri.parse('dart:convert'), 226 Uri.parse('dart:convert'),
227 Uri.parse('dart:core'), 227 Uri.parse('dart:core'),
(...skipping 25 matching lines...) Expand all
253 /// Report that metric [name] took [time] micro-seconds to process 253 /// Report that metric [name] took [time] micro-seconds to process
254 /// [inputSize] characters. 254 /// [inputSize] characters.
255 void report(String name, int time) { 255 void report(String name, int time) {
256 var sb = new StringBuffer(); 256 var sb = new StringBuffer();
257 var padding = ' ' * (20 - name.length); 257 var padding = ' ' * (20 - name.length);
258 sb.write('$name:$padding $time us, ${time ~/ 1000} ms'); 258 sb.write('$name:$padding $time us, ${time ~/ 1000} ms');
259 var invSpeed = (time * 1000 / inputSize).toStringAsFixed(2); 259 var invSpeed = (time * 1000 / inputSize).toStringAsFixed(2);
260 sb.write(', $invSpeed ns/char'); 260 sb.write(', $invSpeed ns/char');
261 print('$sb'); 261 print('$sb');
262 } 262 }
OLDNEW
« no previous file with comments | « pkg/front_end/test/fasta/testing/suite.dart ('k') | pkg/kernel/lib/target/flutter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698