You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a third-party package with heavy .d.ts files (eg aws-sdk) slows down tsc -b drastically comparing to tsc -p compilation time.
Comparison of the tsc extendedDiagnostics:
tsc -b api/tsconfig.json -w --preserveWatchOutput (or run npm run dev:api:b)
Much slower after adding a change to the code (eg console.log in a TS file).
Files: 412
Lines of Library: 8664
Lines of Definitions: 577202
Lines of TypeScript: 34
Lines of JavaScript: 0
Lines of JSON: 0
Lines of Other: 0
Nodes of Library: 23282
Nodes of Definitions: 1689642
Nodes of TypeScript: 137
Nodes of JavaScript: 0
Nodes of JSON: 0
Nodes of Other: 0
Identifiers: 626998
Symbols: 367869
Types: 261
Instantiations: 276
Memory used: 512906K
Assignability cache size: 29
Identity cache size: 1
Subtype cache size: 10
Strict subtype cache size: 0
I/O Read time: 0.24s
Parse time: 2.67s
ResolveModule time: 0.09s
ResolveTypeReference time: 0.00s
Program time: 3.18s
Bind time: 0.93s
Check time: 0.04s
transformTime time: 0.02s
commentTime time: 0.00s
printTime time: 0.04s
Emit time: 0.04s
Source Map time: 0.00s
I/O Write time: 0.00s
Total time: 4.20s
tsc -p api/tsconfig.json -w --preserveWatchOutput (or run npm run dev:api:p)
Much faster after adding a change to the code (eg console.log in a TS file).
Files: 412
Lines of Library: 8664
Lines of Definitions: 577202
Lines of TypeScript: 34
Lines of JavaScript: 0
Lines of JSON: 0
Lines of Other: 0
Nodes of Library: 23282
Nodes of Definitions: 1689642
Nodes of TypeScript: 137
Nodes of JavaScript: 0
Nodes of JSON: 0
Nodes of Other: 0
Identifiers: 626998
Symbols: 367869
Types: 261
Instantiations: 276
Memory used: 513037K
Assignability cache size: 29
Identity cache size: 1
Subtype cache size: 10
Strict subtype cache size: 0
I/O Read time: 0.00s
Parse time: 0.00s
ResolveModule time: 0.00s
Program time: 0.01s
Bind time: 0.00s
Check time: 0.05s
transformTime time: 0.02s
commentTime time: 0.00s
printTime time: 0.05s
Emit time: 0.05s
Source Map time: 0.00s
I/O Write time: 0.00s
Total time: 0.11s
🔎 Search Terms
tsc, typescript compiler, build mode, watch mode
🕗 Version & Regression Information
Tested on typescript 3.9.3, 4.4.2, 4.4.3. Same behaviour.
⏯ Playground Link
https://github.com/zofiag/tsc-test - it is a super simple repo project with almost no code, except for the aws-sdk dependency installed that seems to drastically slow down the compilation in build mode.
After cloning the repo, run npm install and:
run npm run dev:api:b for the tsc -b compilation
run npm run dev:api:p for the tsc -p compilation
Running tsc -b -w is much slower (total time 4.20s) than tsc -p -w (total time 0.11s). The library that seems to be slowing it down is aws-sdk package which is the only dependency in this small repro project.
Why would the same package be parsed much slower in the build mode?
🙂 Expected behavior
Compilation time after adding a change (eg console.log in the TS file) should be nearly the same between tsc -b -w and tsc -p -w when there are no project references specified.
The text was updated successfully, but these errors were encountered:
Bug Report
Using a third-party package with heavy .d.ts files (eg
aws-sdk
) slows downtsc -b
drastically comparing totsc -p
compilation time.Comparison of the
tsc extendedDiagnostics
:tsc -b api/tsconfig.json -w --preserveWatchOutput
(or runnpm run dev:api:b
)Much slower after adding a change to the code (eg console.log in a TS file).
tsc -p api/tsconfig.json -w --preserveWatchOutput
(or runnpm run dev:api:p
)Much faster after adding a change to the code (eg console.log in a TS file).
🔎 Search Terms
tsc, typescript compiler, build mode, watch mode
🕗 Version & Regression Information
Tested on typescript 3.9.3, 4.4.2, 4.4.3. Same behaviour.
⏯ Playground Link
https://github.com/zofiag/tsc-test - it is a super simple repo project with almost no code, except for the
aws-sdk
dependency installed that seems to drastically slow down the compilation in build mode.After cloning the repo, run
npm install
and:run
npm run dev:api:b
for thetsc -b
compilationrun
npm run dev:api:p
for thetsc -p
compilation💻 Code
Project structure:
api/tsconfig.json
api/src/aws-encryption.ts
shared/tsconfig.json
tsconfig.base.json
🙁 Actual behavior
Running
tsc -b -w
is much slower (total time 4.20s) thantsc -p -w
(total time 0.11s). The library that seems to be slowing it down isaws-sdk
package which is the only dependency in this small repro project.Why would the same package be parsed much slower in the build mode?
🙂 Expected behavior
Compilation time after adding a change (eg console.log in the TS file) should be nearly the same between
tsc -b -w
andtsc -p -w
when there are no project references specified.The text was updated successfully, but these errors were encountered: