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

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

Issue 918383002: Rework analysis server performance measurement code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 /** The entry point for the analyzer. */ 6 /** The entry point for the analyzer. */
7 library analyzer; 7 library analyzer;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 import 'dart:convert'; 10 import 'dart:convert';
11 import 'dart:io'; 11 import 'dart:io';
12 12
13 import 'package:analyzer/options.dart'; 13 import 'package:analyzer/options.dart';
14 import 'package:analyzer/src/analyzer_impl.dart'; 14 import 'package:analyzer/src/analyzer_impl.dart';
15 import 'package:analyzer/src/generated/engine.dart'; 15 import 'package:analyzer/src/generated/engine.dart';
16 import 'package:analyzer/src/generated/error.dart'; 16 import 'package:analyzer/src/generated/error.dart';
17 import 'package:analyzer/src/generated/interner.dart'; 17 import 'package:analyzer/src/generated/interner.dart';
18 import 'package:analyzer/src/generated/java_core.dart' show JavaSystem; 18 import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
19 import 'package:analyzer/src/generated/java_engine.dart'; 19 import 'package:analyzer/src/generated/java_engine.dart';
20 import 'package:analyzer/src/generated/utilities_general.dart';
20 21
21 void main(List<String> args) { 22 void main(List<String> args) {
22 StringUtilities.INTERNER = new MappedInterner(); 23 StringUtilities.INTERNER = new MappedInterner();
23 CommandLineOptions options = CommandLineOptions.parse(args); 24 CommandLineOptions options = CommandLineOptions.parse(args);
24 if (options.shouldBatch) { 25 if (options.shouldBatch) {
25 BatchRunner.runAsBatch(args, (List<String> args) { 26 BatchRunner.runAsBatch(args, (List<String> args) {
26 CommandLineOptions options = CommandLineOptions.parse(args); 27 CommandLineOptions options = CommandLineOptions.parse(args);
27 return _analyzeAll(options); 28 return _analyzeAll(options);
28 }); 29 });
29 } else { 30 } else {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 int startTime = JavaSystem.currentTimeMillis(); 64 int startTime = JavaSystem.currentTimeMillis();
64 AnalyzerImpl analyzer = new AnalyzerImpl(sourcePath, options, startTime); 65 AnalyzerImpl analyzer = new AnalyzerImpl(sourcePath, options, startTime);
65 analyzer.analyzeSync(printMode: 2); 66 analyzer.analyzeSync(printMode: 2);
66 67
67 for (int i = 0; i < 8; i++) { 68 for (int i = 0; i < 8; i++) {
68 startTime = JavaSystem.currentTimeMillis(); 69 startTime = JavaSystem.currentTimeMillis();
69 analyzer = new AnalyzerImpl(sourcePath, options, startTime); 70 analyzer = new AnalyzerImpl(sourcePath, options, startTime);
70 analyzer.analyzeSync(printMode: 0); 71 analyzer.analyzeSync(printMode: 0);
71 } 72 }
72 73
73 PerformanceStatistics.reset(); 74 PerformanceTag.reset();
74 startTime = JavaSystem.currentTimeMillis(); 75 startTime = JavaSystem.currentTimeMillis();
75 analyzer = new AnalyzerImpl(sourcePath, options, startTime); 76 analyzer = new AnalyzerImpl(sourcePath, options, startTime);
76 return analyzer.analyzeSync(); 77 return analyzer.analyzeSync();
77 } 78 }
78 int startTime = JavaSystem.currentTimeMillis(); 79 int startTime = JavaSystem.currentTimeMillis();
79 AnalyzerImpl analyzer = new AnalyzerImpl(sourcePath, options, startTime); 80 AnalyzerImpl analyzer = new AnalyzerImpl(sourcePath, options, startTime);
80 var errorSeverity = analyzer.analyzeSync(); 81 var errorSeverity = analyzer.analyzeSync();
81 if (errorSeverity == ErrorSeverity.ERROR) { 82 if (errorSeverity == ErrorSeverity.ERROR) {
82 exitCode = errorSeverity.ordinal; 83 exitCode = errorSeverity.ordinal;
83 } 84 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 '>>> TEST $resultPassString ${stopwatch.elapsedMilliseconds}ms'); 140 '>>> TEST $resultPassString ${stopwatch.elapsedMilliseconds}ms');
140 } catch (e, stackTrace) { 141 } catch (e, stackTrace) {
141 stderr.writeln(e); 142 stderr.writeln(e);
142 stderr.writeln(stackTrace); 143 stderr.writeln(stackTrace);
143 stderr.writeln('>>> EOF STDERR'); 144 stderr.writeln('>>> EOF STDERR');
144 stdout.writeln('>>> TEST CRASH'); 145 stdout.writeln('>>> TEST CRASH');
145 } 146 }
146 }); 147 });
147 } 148 }
148 } 149 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | pkg/analyzer/lib/src/analyzer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698