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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart

Issue 2917183003: update the analyzer and analysis server perf tags (Closed)
Patch Set: updates for review comments Created 3 years, 6 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
Index: pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
index 4987624e24c485b77471c59be6a9b6a5434db4c8..9dbffe77c63e5bd20850d267b3e577a1571bea57 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
@@ -60,6 +60,12 @@ class LibraryAnalyzer {
* Compute analysis results for all units of the library.
*/
Map<FileState, UnitAnalysisResult> analyze() {
+ return PerformanceStatistics.analysis.makeCurrentWhile(() {
+ return _analyze();
+ });
+ }
+
+ Map<FileState, UnitAnalysisResult> _analyze() {
Map<FileState, CompilationUnit> units = {};
// Parse all files.
@@ -92,32 +98,38 @@ class LibraryAnalyzer {
_computeConstants();
- units.forEach((file, unit) {
- _computeVerifyErrors(file, unit);
+ PerformanceStatistics.errors.makeCurrentWhile(() {
+ units.forEach((file, unit) {
+ _computeVerifyErrors(file, unit);
+ });
});
if (_analysisOptions.hint) {
- units.forEach((file, unit) {
- {
- var visitor = new GatherUsedLocalElementsVisitor(_libraryElement);
- unit.accept(visitor);
- _usedLocalElementsList.add(visitor.usedElements);
- }
- {
- var visitor =
- new GatherUsedImportedElementsVisitor(_libraryElement);
- unit.accept(visitor);
- _usedImportedElementsList.add(visitor.usedElements);
- }
- });
- units.forEach((file, unit) {
- _computeHints(file, unit);
+ PerformanceStatistics.hints.makeCurrentWhile(() {
+ units.forEach((file, unit) {
+ {
+ var visitor = new GatherUsedLocalElementsVisitor(_libraryElement);
+ unit.accept(visitor);
+ _usedLocalElementsList.add(visitor.usedElements);
+ }
+ {
+ var visitor =
+ new GatherUsedImportedElementsVisitor(_libraryElement);
+ unit.accept(visitor);
+ _usedImportedElementsList.add(visitor.usedElements);
+ }
+ });
+ units.forEach((file, unit) {
+ _computeHints(file, unit);
+ });
});
}
if (_analysisOptions.lint) {
- units.forEach((file, unit) {
- _computeLints(file, unit);
+ PerformanceStatistics.lints.makeCurrentWhile(() {
+ units.forEach((file, unit) {
+ _computeLints(file, unit);
+ });
});
}
} finally {

Powered by Google App Engine
This is Rietveld 408576698