angular-cn/packages/compiler-cli
JoostK f0688b4d18 perf(ngcc): introduce cache for sharing data across entry-points (#38840)
ngcc creates typically two `ts.Program` instances for each entry-point,
one for processing sources and another one for processing the typings.
The creation of these programs is somewhat expensive, as it concerns
module resolution and parsing of source files.

This commit implements several layers of caching to optimize the
creation of programs:

1. A shared module resolution cache across all entry-points within a
   single invocation of ngcc. Both the sources and typings program
   benefit from this cache.
2. Sharing the parsed `ts.SourceFile` for a single entry-point between
   the sources and typings program.
3. Sharing parsed `ts.SourceFile`s of TypeScript's default libraries
   across all entry-points within a single invocation. Some of these
   default library typings are large and therefore expensive to parse,
   so sharing the parsed source files across all entry-points offers
   a significant performance improvement.

Using a bare CLI app created using `ng new` + `ng add @angular/material`,
the above changes offer a 3-4x improvement in ngcc's processing time
when running synchronously and ~2x improvement for asynchronous runs.

PR Close #38840
2020-09-15 11:23:04 -07:00
..
integrationtest fix(bazel): ng_module rule does not expose flat module information in Ivy (#36971) 2020-07-09 22:11:17 +00:00
ngcc perf(ngcc): introduce cache for sharing data across entry-points (#38840) 2020-09-15 11:23:04 -07:00
src perf(compiler-cli): optimize computation of type-check scope information (#38539) 2020-09-14 11:54:40 -07:00
test fix(compiler-cli): ensure that a declaration is available in type-to-value conversion (#38684) 2020-09-08 14:06:25 -07:00
BUILD.bazel build(compiler-cli): fix bazel deps rules for ngtsc testing packages (#37977) 2020-07-08 12:05:22 -07:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json feat(compiler-cli): add support for TypeScript 4.0 (#38076) 2020-08-24 13:06:59 -07:00
tsconfig-build.json build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
tsconfig.json perf(ivy): ngcc - only find dependencies when targeting a single entry-point (#30525) 2019-07-09 09:40:46 -07:00