Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance regression when a file is imported by many importers #3641

Merged
merged 2 commits into from Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Graph.ts
Expand Up @@ -196,15 +196,15 @@ export default class Graph {
}
return {
dynamicallyImportedIds,
dynamicImporters: foundModule.dynamicImporters,
dynamicImporters: foundModule.dynamicImporters.sort(),
hasModuleSideEffects: foundModule.moduleSideEffects,
id: foundModule.id,
implicitlyLoadedAfterOneOf:
foundModule instanceof Module ? Array.from(foundModule.implicitlyLoadedAfter, getId) : [],
implicitlyLoadedBefore:
foundModule instanceof Module ? Array.from(foundModule.implicitlyLoadedBefore, getId) : [],
importedIds,
importers: foundModule.importers,
importers: foundModule.importers.sort(),
isEntry: foundModule instanceof Module && foundModule.isEntryPoint,
isExternal: foundModule instanceof ExternalModule
};
Expand Down
2 changes: 0 additions & 2 deletions src/ModuleLoader.ts
Expand Up @@ -294,7 +294,6 @@ export class ModuleLoader {
this.handleResolveId(await this.resolveId(source, module.id), source, module.id))
);
resolution.importers.push(module.id);
resolution.importers.sort();
}),
...module.dynamicImports.map(async dynamicImport => {
const resolvedId = await this.resolveDynamicImport(
Expand All @@ -312,7 +311,6 @@ export class ModuleLoader {
resolvedId
));
resolution.dynamicImporters.push(module.id);
resolution.dynamicImporters.sort();
}
})
]);
Expand Down