-
Notifications
You must be signed in to change notification settings - Fork 202
Performance regression with project build in da663656 ... #590
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
Comments
Running |
I'll have a look 🌹 Notes to self:
|
A normal call to
But in your code it is taking 1500ms! :
How to testWrap this line as follows: let start = new Date();
var output = services.getEmitOutput(filePath);
console.error(`${filePath}: ${(new Date()).getTime() - start.getTime()}ms`) Recommend raising this with Microsoft/TypeScript. |
Has to do with compiler options. The following definitely speeds is back to 3.5s mark: "compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"preserveConstEnums": true,
"outDir": "../dist",
"sourceMap": false,
"jsx": "react"
}, |
The culprit is |
Will do. Thanks @basarat ! |
From the linked issue microsoft/TypeScript#4894 (comment), this is by design 🌹 |
Thanks for investigating. The explanation makes sense, although it should be possible to preserve the purpose of 'noEmitOnError', making sure that the JS on disk only reflects the last-successfully-typechecked state of the project, in an incremental way. That's something to be discussed upstream I think. A short term measure in atom-typescript would be to abort the build with an error if |
I've created a separate issue to track your ideas : #603 |
Disable noEmitOnError because it is not compatible with incremental compile-on-save with Atom Typescript. See TypeStrong/atom-typescript#590 for the full back story.
Pressing F6 to build my project went from about 5 seconds to several minutes.
Adding logging to the
build()
function inprojectService.ts
shows that calls toemitFile()
are taking ~1500-3000ms per file and my project has ~170 TS source files.Via
git bisect
I've narrowed it down to either c797b2d or da66365 (the former is a fix needed to actually build the project, so I can't test between these two without source changes).The text was updated successfully, but these errors were encountered: