Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit eb131c3

Browse files
committed
[kernel worker] Don't do unnecessary computeCanonicalNames
This was a left-over from when unbinding, and should no longer be needed. An internal benchmark of lots of outline calculations in worker mode with reuse and the incremental compiler goes from ~248 seconds to ~215 seconds. Change-Id: Iedb6a3fb11504610c061503efb741e35919f0d32 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103629 Reviewed-by: Kevin Millikin <[email protected]>
1 parent ec3cd7f commit eb131c3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

pkg/front_end/lib/src/api_unstable/bazel_worker.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,17 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
124124
for (var lib in sdkComponent.libraries) {
125125
lib.isExternal = cachedSdkInput.externalLibs.contains(lib.importUri);
126126
}
127+
128+
// Make sure the canonical name root knows about the sdk - otherwise we
129+
// won't be able to link to it when loading more outlines.
127130
sdkComponent.adoptChildren();
131+
132+
// TODO(jensj): This is - at least currently - neccessary,
133+
// although it's not entirely obvious why.
134+
// It likely has to do with several outlines containing the same libraries.
135+
// Once that stops (and we check for it) we can probably remove this,
136+
// and instead only do it when about to reuse an outline in the
137+
// 'inputSummaries.add(component);' line further down.
128138
for (WorkerInputComponent cachedInput in workerInputCache.values) {
129139
cachedInput.component.adoptChildren();
130140
}
@@ -157,8 +167,6 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
157167
for (var lib in component.libraries) {
158168
lib.isExternal = cachedInput.externalLibs.contains(lib.importUri);
159169
}
160-
component.adoptChildren();
161-
component.computeCanonicalNames();
162170
inputSummaries.add(component);
163171
}
164172
}

pkg/front_end/test/incremental_load_from_dill_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ Future<Null> newWorldTest(
307307
for (String moduleName in world["modules"]) {
308308
Component moduleComponent = moduleComponents[moduleName];
309309
if (moduleComponent != null) {
310-
moduleComponent.computeCanonicalNames();
311310
modulesToUse.add(moduleComponent);
312311
}
313312
}

0 commit comments

Comments
 (0)