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

Side by Side Diff: pkg/analyzer/lib/task/model.dart

Issue 1152923002: Improve logging performance (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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/analyzer/lib/instrumentation/instrumentation.dart ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.task.model; 5 library analyzer.task.model;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; 9 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
10 import 'package:analyzer/src/generated/java_engine.dart'; 10 import 'package:analyzer/src/generated/java_engine.dart';
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 void _safelyPerform() { 213 void _safelyPerform() {
214 try { 214 try {
215 // 215 //
216 // Report that this task is being performed. 216 // Report that this task is being performed.
217 // 217 //
218 String contextName = context.name; 218 String contextName = context.name;
219 if (contextName == null) { 219 if (contextName == null) {
220 contextName = 'unnamed'; 220 contextName = 'unnamed';
221 } 221 }
222 AnalysisEngine.instance.instrumentationService.logAnalysisTask( 222 AnalysisEngine.instance.instrumentationService.logAnalysisTask(
223 contextName, description); 223 contextName, this);
224 // 224 //
225 // Gather statistics on the performance of the task. 225 // Gather statistics on the performance of the task.
226 // 226 //
227 int count = countMap[runtimeType]; 227 int count = countMap[runtimeType];
228 countMap[runtimeType] = count == null ? 1 : count + 1; 228 countMap[runtimeType] = count == null ? 1 : count + 1;
229 Stopwatch stopwatch = stopwatchMap[runtimeType]; 229 Stopwatch stopwatch = stopwatchMap[runtimeType];
230 if (stopwatch == null) { 230 if (stopwatch == null) {
231 stopwatch = new Stopwatch(); 231 stopwatch = new Stopwatch();
232 stopwatchMap[runtimeType] = stopwatch; 232 stopwatchMap[runtimeType] = stopwatch;
233 } 233 }
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 * be computed, or `false` if the inputs have been computed. 501 * be computed, or `false` if the inputs have been computed.
502 * 502 *
503 * It is safe to invoke [moveNext] after it has returned `false`. In this case 503 * It is safe to invoke [moveNext] after it has returned `false`. In this case
504 * [moveNext] has no effect and will again return `false`. 504 * [moveNext] has no effect and will again return `false`.
505 * 505 *
506 * Throws a [StateError] if the value of the current result has not been 506 * Throws a [StateError] if the value of the current result has not been
507 * provided using [currentValue]. 507 * provided using [currentValue].
508 */ 508 */
509 bool moveNext(); 509 bool moveNext();
510 } 510 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/instrumentation/instrumentation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698