perf(ivy): use module resolution cache (#34332)

During TypeScript module resolution, a lot of filesystem requests are
done. This is quite an expensive operation, so a module resolution cache
can be used to speed up the process significantly.

This commit lets the Ivy compiler perform all module resolution with a
module resolution cache. Note that the module resolution behavior can be
changed with a custom compiler host, in which case that custom host
implementation is responsible for caching. In the case of the Angular
CLI a custom compiler host with proper module resolution caching is
already in place, so the CLI already has this optimization.

PR Close #34332
This commit is contained in:
JoostK
2019-12-07 22:38:36 +01:00
committed by Kara Erickson
parent 2f5ddd9c96
commit 8c2cbdd385
13 changed files with 56 additions and 46 deletions

View File

@ -39,7 +39,7 @@ export class RouterEntryPointManager {
if (moduleName === undefined) {
return null;
}
const resolvedSf = this.moduleResolver.resolveModuleName(relativeFile, context);
const resolvedSf = this.moduleResolver.resolveModule(relativeFile, context.fileName);
if (resolvedSf === null) {
return null;
}