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

Unified Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1820473002: Conditional AST timing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 408db9e179fd4428465287be74c85d0dd8830b46..063a7d9ab2793a40ac1a328dd4c0d97c936345d7 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -2815,13 +2815,16 @@ class GenerateLintsTask extends SourceBasedAnalysisTask {
//
List<AstVisitor> visitors = <AstVisitor>[];
+ bool timeVisits = analysisOptions.enableTiming;
List<Linter> linters = getLints(context);
for (Linter linter in linters) {
AstVisitor visitor = linter.getVisitor();
if (visitor != null) {
linter.reporter = errorReporter;
- visitors
- .add(new TimedAstVisitor(visitor, lintRegistry.getTimer(linter)));
+ if (timeVisits) {
+ visitor = new TimedAstVisitor(visitor, lintRegistry.getTimer(linter));
+ }
+ visitors.add(visitor);
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698