Skip to content
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

TypeScript 4.3 substantially slower compilation than 4.2 #44283

Closed
olmobrutall opened this issue May 26, 2021 · 3 comments
Closed

TypeScript 4.3 substantially slower compilation than 4.2 #44283

olmobrutall opened this issue May 26, 2021 · 3 comments
Labels
Domain: Performance Reports of unusually slow behavior Duplicate An existing issue was already created Fixed A PR has been merged for this issue

Comments

@olmobrutall
Copy link

olmobrutall commented May 26, 2021

Bug Report

I've been analyzing the performance of the upgrading https://github.com/signumsoftware/southwind/tree/cfe00a16d763cfecbc061da70271781698171c1f to the latest version of Typescript:

The solution consist in a dozen of csproj with three projects containing .tsconfig and depending on each other, each in a different git submodule:

Southwind.React -> Signum.React.Extensions -> Signum.React
https://github.com/signumsoftware/southwind/blob/cfe00a16d763cfecbc061da70271781698171c1f/Southwind.React/tsconfig.json
https://github.com/signumsoftware/extensions/blob/1f4e089233981033d646778f6102edb9747654ec/Signum.React.Extensions/tsconfig.json
https://github.com/signumsoftware/framework/blob/3b626662396d35d21ff495bf99bf9ac91714f8a4/Signum.React/tsconfig.json

I've updated all three projects:

NPM typescript "4.2.3" to "4.3.2"
NuGet Microsoft.TypeScript.MSBuild "4.2.4" to "4.3.2"

And I've analyzed the following scenarios:

Compiler

  • CSharp only: Compiling in Visual Studio 2019 with <TypeScriptCompileBlocked>to have an idea of the C# part.
  • VS: Compiling in VS2019 both C# and Typescript using Microsoft.TypeScript.MSBuild
  • tsc: compiling by command line in Southwind.React folder

Scenario:

  • Clean rebuild of the full solution in VS or ´yarn run tsc --build --force`
  • Build solution in VS or yarn run tsc after changes in different files (just adding and removing empty lines):
    * Navigator.tsx (in Signum.React, deeper dependency)
    * AuthClient.tsx (in Signum.React.Extensions, middle dependency)
    * MainPublic.tsx (in Southwind.React, entry point)
  • Build with no changes.

For each case I've taken three measures and calculated the average:

image

Am I doing something wrong in the .tsconfig files? or is this an important performance regression?

Also note how when using TypeScriptCompileBlocked VS is able to detect the projects as "UpToDate" (00:00), while with TypeScript activated he is forced to recompile this projects most of the time (some times not, but I can not reproduce it reliably).

@amcasey
Copy link
Member

amcasey commented Jun 4, 2021

Thanks for the feedback! I believe this is the same issue as #44305. In particular, when I patch 4.3.2 with #44394 the new delay goes away. (I only tested on the command line, not in VS, but I believe the cause is the same.)

#44431 should bring the fix to the next patch of TS 4.3.

@amcasey amcasey closed this as completed Jun 4, 2021
@amcasey amcasey added Domain: Performance Reports of unusually slow behavior Fixed A PR has been merged for this issue labels Jun 4, 2021
@DanielRosenwasser DanielRosenwasser added Duplicate An existing issue was already created and removed Domain: Performance Reports of unusually slow behavior labels Jun 4, 2021
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.3.3 milestone Jun 4, 2021
@DanielRosenwasser DanielRosenwasser added the Domain: Performance Reports of unusually slow behavior label Jun 4, 2021
@olmobrutall
Copy link
Author

Look like the NPM package is published: https://www.npmjs.com/package/typescript/v/4.3.4

But the Nuget package is not: https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild/

Any chance to get an updated NuGet before 4.4?

@olmobrutall
Copy link
Author

Just a follow up after upgrading to TS 4.4

image

Looks like the issue is gone as @amcasey mentioned, and there are real improvements from 4.4 to 4.2, even if in every version the compiler is getting smarter and doing more checks.

Great work TS Team!

olmobrutall referenced this issue in signumsoftware/framework Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Performance Reports of unusually slow behavior Duplicate An existing issue was already created Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants