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

Side by Side Diff: pkg/analyzer/bin/analyzer.dart

Issue 123533002: Capture and print times for the isInstanceOf method (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Duplicated update of java_core Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 2
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 /** The entry point for the analyzer. */ 7 /** The entry point for the analyzer. */
8 library analyzer; 8 library analyzer;
9 9
10 import 'dart:async'; 10 import 'dart:async';
11 import 'dart:convert'; 11 import 'dart:convert';
12 import 'dart:io'; 12 import 'dart:io';
13 13
14 import 'package:analyzer/src/generated/engine.dart'; 14 import 'package:analyzer/src/generated/engine.dart';
15 import 'package:analyzer/src/generated/error.dart'; 15 import 'package:analyzer/src/generated/error.dart';
16 import 'package:analyzer/src/generated/java_core.dart' show JavaSystem; 16 import 'package:analyzer/src/generated/java_core.dart' show JavaSystem, instance OfTimer;
17 import 'package:analyzer/options.dart'; 17 import 'package:analyzer/options.dart';
18 18
19 import 'package:analyzer/src/analyzer_impl.dart'; 19 import 'package:analyzer/src/analyzer_impl.dart';
20 import 'package:analyzer/src/error_formatter.dart'; 20 import 'package:analyzer/src/error_formatter.dart';
21 21
22 void main(args) { 22 void main(args) {
23 var options = CommandLineOptions.parse(args); 23 var options = CommandLineOptions.parse(args);
24 if (options.shouldBatch) { 24 if (options.shouldBatch) {
25 BatchRunner.runAsBatch(args, (List<String> args) { 25 BatchRunner.runAsBatch(args, (List<String> args) {
26 var options = CommandLineOptions.parse(args); 26 var options = CommandLineOptions.parse(args);
27 return _runAnalyzer(options); 27 return _runAnalyzer(options);
28 }); 28 });
29 } else { 29 } else {
30 int startTime = JavaSystem.currentTimeMillis(); 30 int startTime = JavaSystem.currentTimeMillis();
31 31
32 ErrorSeverity result = _runAnalyzer(options); 32 ErrorSeverity result = _runAnalyzer(options);
33 33
34 if (options.perf) { 34 if (options.perf) {
35 int totalTime = JavaSystem.currentTimeMillis() - startTime; 35 int totalTime = JavaSystem.currentTimeMillis() - startTime;
36 print("scan:${PerformanceStatistics.scan.result}"); 36 print("scan:${PerformanceStatistics.scan.result}");
37 print("parse:${PerformanceStatistics.parse.result}"); 37 print("parse:${PerformanceStatistics.parse.result}");
38 print("resolve:${PerformanceStatistics.resolve.result}"); 38 print("resolve:${PerformanceStatistics.resolve.result}");
39 print("errors:${PerformanceStatistics.errors.result}"); 39 print("errors:${PerformanceStatistics.errors.result}");
40 print("hints:${PerformanceStatistics.hints.result}"); 40 print("hints:${PerformanceStatistics.hints.result}");
41 print("instanceof:${instanceOfTimer.elapsedMilliseconds}");
41 print("total:$totalTime"); 42 print("total:$totalTime");
42 } 43 }
43 44
44 exit(result.ordinal); 45 exit(result.ordinal);
45 } 46 }
46 } 47 }
47 48
48 ErrorSeverity _runAnalyzer(CommandLineOptions options) { 49 ErrorSeverity _runAnalyzer(CommandLineOptions options) {
49 if (!options.machineFormat) { 50 if (!options.machineFormat) {
50 stdout.writeln("Analyzing ${options.sourceFiles}..."); 51 stdout.writeln("Analyzing ${options.sourceFiles}...");
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon ds}ms'); 130 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon ds}ms');
130 } catch (e, stackTrace) { 131 } catch (e, stackTrace) {
131 stderr.writeln(e); 132 stderr.writeln(e);
132 stderr.writeln(stackTrace); 133 stderr.writeln(stackTrace);
133 stderr.writeln('>>> EOF STDERR'); 134 stderr.writeln('>>> EOF STDERR');
134 stdout.writeln('>>> TEST CRASH'); 135 stdout.writeln('>>> TEST CRASH');
135 } 136 }
136 }); 137 });
137 } 138 }
138 } 139 }
OLDNEW
« no previous file with comments | « editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart ('k') | pkg/analyzer/lib/src/generated/java_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698