Skip to content

Commit 08b5082

Browse files
scheglovCommit Queue
authored andcommitted
Macro. Reuse parsed unit when merging macro results.
This saves another 160 ms. Bug: #55784 Change-Id: If626d616999b85edaaa4028cbe5fc70fbc1bf86a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372960 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent ef1ec76 commit 08b5082

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pkg/analyzer/lib/src/summary2/library_builder.dart

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,11 @@ class LibraryBuilder with MacroApplicationsContainer {
579579
var importedAugmentation = importState.importedAugmentation!;
580580
var importedFile = importedAugmentation.file;
581581

582-
var unitNode = performance.run(
583-
'importedFile.parse()',
584-
(performance) {
585-
performance.getDataInt('length').add(importedFile.content.length);
586-
return importedFile.parse(
587-
performance: performance,
588-
);
589-
},
582+
var importedFileParsed = importedFile.getParsed(
583+
performance: performance,
590584
);
585+
var unitNode = importedFileParsed.unit;
586+
591587
var unitElement = CompilationUnitElementImpl(
592588
source: importedFile.source,
593589
librarySource: importedFile.source,

0 commit comments

Comments
 (0)