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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/file_state.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/file_state.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 93ac117499661dc09c6ef711b5b69d8b3a9dbe08..f441c981033fccc578defb0069a08d363ff80656 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -381,13 +381,24 @@ class FileState {
* Return a new parsed unresolved [CompilationUnit].
*/
CompilationUnit parse(AnalysisErrorListener errorListener) {
+ return PerformanceStatistics.parse.makeCurrentWhile(() {
+ return _parse(errorListener);
+ });
+ }
+
+ CompilationUnit _parse(AnalysisErrorListener errorListener) {
AnalysisOptions analysisOptions = _fsState._analysisOptions;
if (USE_FASTA_PARSER) {
try {
- fasta.ScannerResult scanResult = fasta.scan(_contentBytes,
+ fasta.ScannerResult scanResult =
+ PerformanceStatistics.scan.makeCurrentWhile(() {
+ return fasta.scan(
+ _contentBytes,
includeComments: true,
- scanGenericMethodComments: analysisOptions.strongMode);
+ scanGenericMethodComments: analysisOptions.strongMode,
+ );
+ });
var astBuilder = new fasta.AstBuilder(
new ErrorReporter(errorListener, source),
@@ -415,7 +426,9 @@ class FileState {
CharSequenceReader reader = new CharSequenceReader(content);
Scanner scanner = new Scanner(source, reader, errorListener);
scanner.scanGenericMethodComments = analysisOptions.strongMode;
- Token token = scanner.tokenize();
+ Token token = PerformanceStatistics.scan.makeCurrentWhile(() {
+ return scanner.tokenize();
+ });
LineInfo lineInfo = new LineInfo(scanner.lineStarts);
Parser parser = new Parser(source, errorListener);

Powered by Google App Engine
This is Rietveld 408576698