Skip to content

Commit c3a4f56

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Return from LibraryContext without logging if the cycle is already loaded.
It writes too much, and with fine grained dependencies this is especially prominent, we don't do analysis for most of files afterwards. Change-Id: Idccef82f3b46980b6942c403871f588e21e128c1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408680 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent c040cd6 commit c3a4f56

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

pkg/analyzer/lib/src/dart/analysis/library_context.dart

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,20 @@ class LibraryContext {
196196
}
197197
}
198198

199+
var libraryCycle = performance.run('libraryCycle', (performance) {
200+
fileSystemState.newFileOperationPerformance = performance;
201+
try {
202+
return targetLibrary.libraryCycle;
203+
} finally {
204+
fileSystemState.newFileOperationPerformance = null;
205+
}
206+
});
207+
208+
if (loadedBundles.contains(libraryCycle)) {
209+
return;
210+
}
211+
199212
logger.run('Prepare linked bundles', () {
200-
var libraryCycle = performance.run('libraryCycle', (performance) {
201-
fileSystemState.newFileOperationPerformance = performance;
202-
try {
203-
return targetLibrary.libraryCycle;
204-
} finally {
205-
fileSystemState.newFileOperationPerformance = null;
206-
}
207-
});
208213
loadBundle(libraryCycle);
209214
logger.writeln(
210215
'[librariesTotal: $librariesTotal]'

0 commit comments

Comments
 (0)