Repository navigation
Commit 3deb68f
committed
perf(@angular/build): avoid loading compiler-cli and typescript in js transform worker
Previously, `OxcLinker` imported `ConsoleLogger` and `LogLevel` directly from
`@angular/compiler-cli`. Even though `@angular/compiler-cli/linker` is an isolated,
lightweight runtime (depending only on `semver` and `convert-source-map`), resolving
the main `@angular/compiler-cli` entry point (`bundles/index.js`) eagerly evaluated
the full `ngtsc` compiler toolchain and required the 10 MB `typescript.js` bundle at
the top level.
As a result, every worker isolate in the JavaScript transformer pool unnecessarily loaded
TypeScript and 50+ compiler modules upon bootstrap, incurring ~150 ms of startup CPU latency
and allocating ~12 MB of heap per worker thread.1 parent eb2ba36 commit 3deb68f
1 file changed
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
49 | 65 | | |
50 | 66 | | |
51 | 67 | | |
| |||
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
59 | | - | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
65 | 80 | | |
66 | | - | |
| 81 | + | |
67 | 82 | | |
68 | 83 | | |
69 | 84 | | |
| |||
0 commit comments