Skip to content

TypeScript 4.3 substantially slower compilation than 4.2 #44283

Closed

Description

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).

Activity

  1. amcasey commented on Jun 4, 2021

    @amcasey
    Member

    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.

  2. olmobrutall commented on Jun 22, 2021

    @olmobrutall
    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?

  3. olmobrutall commented on Aug 28, 2021

    @olmobrutall
    Author

    Just a follow up after upgrading to TS 4.4

    image

    Looks like the issue is gone as Andrew Casey (@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!

  4. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: PerformanceReports of unusually slow behaviorDuplicateAn existing issue was already createdFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions