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

Non-incremental build 85% slower with V5 #506

Closed
belaczek opened this issue Aug 30, 2020 · 4 comments
Closed

Non-incremental build 85% slower with V5 #506

belaczek opened this issue Aug 30, 2020 · 4 comments

Comments

@belaczek
Copy link

belaczek commented Aug 30, 2020

Current behavior

I experience a major increase in production build time after upgrading the library from 4.1.6 to 5.1.0. The project is quite large (~250k LOC) and since our CI doesn't preserve generated cache files between builds, we have omitted incremental build options.

Following is a comparison of configurations and compilation times between 4.1.6 and 5.1.0.

V4.1.6

Configuration

new ForkTsCheckerWebpackPlugin({
      tsconfig: PROJECT_PATHS.tsConfig,
      async: false,
      useTypescriptIncrementalApi: false,
      measureCompilationTime: true,
    }),

Compilation took: 47112.32 ms.

V5.1.0

Configuration

 new ForkTsCheckerWebpackPlugin({
      typescript: {
        configFile: PROJECT_PATHS.tsConfig,
        configOverwrite: {
          compilerOptions: {
            sourceMap: false,
            skipLibCheck: true,
            inlineSourceMap: false,
            declarationMap: false,
            noEmit: true,
            incremental: false,
          },
        },
        profile: true,
      },
      async: false,
    }),

Build profile

Parse Configuration:                  0.18 s
Create Watch Compiler Host:           0.00 s
I/O Read:                             1.28 s
Parse:                                3.39 s
ResolveTypeReference:                 0.20 s
ResolveModule:                        9.99 s
Program:                             15.57 s
Bind:                                 2.70 s
Check:                               23.12 s
transformTime:                      274.49 s
Emit:                               276.41 s
Semantic Diagnostics:               301.70 s
Create Watch Program:               321.36 s
Poll And Invoke Created Or Deleted:   0.06 s
Queued Tasks:                         0.00 s

From the build profile of V5 it seems like the emitting phase takes a lot of time even though noEmit is set to true.
I suspect this might be related to #499.

Expected behavior

There isn't any significant performance decrease with the latest version of the library.

Steps to reproduce the issue

Run production build using the configuration above.

Environment

  • fork-ts-checker-webpack-plugin: 5.1.0
  • typescript: 4.0.2
  • webpack: 4.44.1
  • os: MacOS + Jenkins CI build running some linux based docker image
@belaczek belaczek added the bug label Aug 30, 2020
@piotr-oles
Copy link
Collaborator

Sorry for the late response - could you provide a reproduction repository?

@zlk89
Copy link

zlk89 commented Dec 12, 2020

Also seeing this issue, it becomes really slow on after seal step

@piotr-oles
Copy link
Collaborator

@belaczek The latest TypeScript Beta version contains a fix that could potentially fix this issue. Could you test it?

@belaczek
Copy link
Author

Thanks! From brief testing, it looks like the performance really did improve with the latest beta. Especially while having the incremental mode turned on. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants