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

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

Issue 179123010: Add timing info for file IO into Dart based analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | 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';
(...skipping 15 matching lines...) Expand all
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 int ioTime = PerformanceStatistics.io.result;
36 int scanTime = PerformanceStatistics.scan.result; 37 int scanTime = PerformanceStatistics.scan.result;
37 int parseTime = PerformanceStatistics.parse.result; 38 int parseTime = PerformanceStatistics.parse.result;
38 int resolveTime = PerformanceStatistics.resolve.result; 39 int resolveTime = PerformanceStatistics.resolve.result;
39 int errorsTime = PerformanceStatistics.errors.result; 40 int errorsTime = PerformanceStatistics.errors.result;
40 int hintsTime = PerformanceStatistics.hints.result; 41 int hintsTime = PerformanceStatistics.hints.result;
41 int angularTime = PerformanceStatistics.angular.result; 42 int angularTime = PerformanceStatistics.angular.result;
43 print("io:$ioTime");
42 print("scan:$scanTime"); 44 print("scan:$scanTime");
43 print("parse:$parseTime"); 45 print("parse:$parseTime");
44 print("resolve:$resolveTime"); 46 print("resolve:$resolveTime");
45 print("errors:$errorsTime"); 47 print("errors:$errorsTime");
46 print("hints:$hintsTime"); 48 print("hints:$hintsTime");
47 print("angular:$angularTime"); 49 print("angular:$angularTime");
48 print("other:${totalTime 50 print("other:${totalTime
49 - (scanTime + parseTime + resolveTime + errorsTime + hintsTime 51 - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime
50 + angularTime)}"); 52 + angularTime)}");
51 print("total:$totalTime"); 53 print("total:$totalTime");
52 print(""); 54 print("");
53 print("Time spent in instanceof = ${instanceOfTimer.elapsedMilliseconds}") ; 55 print("Time spent in instanceof = ${instanceOfTimer.elapsedMilliseconds}") ;
54 } 56 }
55 exitCode = result.ordinal; 57 exitCode = result.ordinal;
56 } 58 }
57 } 59 }
58 60
59 ErrorSeverity _runAnalyzer(CommandLineOptions options) { 61 ErrorSeverity _runAnalyzer(CommandLineOptions options) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon ds}ms'); 142 stdout.writeln('>>> TEST $resultPassString ${stopwatch.elapsedMillisecon ds}ms');
141 } catch (e, stackTrace) { 143 } catch (e, stackTrace) {
142 stderr.writeln(e); 144 stderr.writeln(e);
143 stderr.writeln(stackTrace); 145 stderr.writeln(stackTrace);
144 stderr.writeln('>>> EOF STDERR'); 146 stderr.writeln('>>> EOF STDERR');
145 stdout.writeln('>>> TEST CRASH'); 147 stdout.writeln('>>> TEST CRASH');
146 } 148 }
147 }); 149 });
148 } 150 }
149 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698