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

perf(dts-plugin): enable tsbuildinfo #3506

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

claneo
Copy link
Contributor

@claneo claneo commented Feb 11, 2025

Description

  • Enable tsc incremental build to reduce compile time.
  • Add tip to disable type check

The following is a benchmark after enabling incremental build and noCheck in a real project with a large number of type errors

Since noCheck is only available in ts 5.5 and above, this pr only enables incremental by default.

hyperfine -i 'npx tsc --project tsconfig.nocheck.json' 'npx tsc --project tsconfig.incremental.json' 'npx tsc --project tsconfig.full.json' 'npx tsc --project tsconfig.base.json'

Benchmark 1: npx tsc --project tsconfig.nocheck.json
  Time (mean ± σ):     16.692 s ±  4.414 s    [User: 18.791 s, System: 1.696 s]
  Range (min … max):   14.638 s … 29.099 s    10 runs
 
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Benchmark 2: npx tsc --project tsconfig.incremental.json
  Time (mean ± σ):      5.960 s ±  0.630 s    [User: 7.025 s, System: 1.125 s]
  Range (min … max):    5.329 s …  6.956 s    10 runs
 
  Warning: Ignoring non-zero exit code.
 
Benchmark 3: npx tsc --project tsconfig.full.json
  Time (mean ± σ):      5.440 s ±  0.357 s    [User: 6.767 s, System: 1.026 s]
  Range (min … max):    4.935 s …  6.004 s    10 runs
 
Benchmark 4: npx tsc --project tsconfig.base.json
  Time (mean ± σ):     124.257 s ± 14.528 s    [User: 139.147 s, System: 12.647 s]
  Range (min … max):   106.390 s … 157.966 s    10 runs
 
  Warning: Ignoring non-zero exit code.
 
Summary
  npx tsc --project tsconfig.full.json ran
    1.10 ± 0.14 times faster than npx tsc --project tsconfig.incremental.json
    3.07 ± 0.84 times faster than npx tsc --project tsconfig.nocheck.json
   22.84 ± 3.06 times faster than npx tsc --project tsconfig.base.json

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Copy link

netlify bot commented Feb 11, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit ec775e6
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/67b6a7fff2027a00087be6bc
😎 Deploy Preview https://deploy-preview-3506--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

changeset-bot bot commented Feb 17, 2025

🦋 Changeset detected

Latest commit: ec775e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
@module-federation/dts-plugin Major
@module-federation/enhanced Major
@module-federation/manifest Major
@module-federation/rspack Major
@module-federation/modern-js Major
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Major
@module-federation/storybook-addon Major
@module-federation/modernjsapp Patch
@module-federation/runtime Major
@module-federation/webpack-bundler-runtime Major
@module-federation/sdk Major
@module-federation/runtime-tools Major
@module-federation/managers Major
@module-federation/third-party-dts-extractor Major
@module-federation/devtools Major
@module-federation/bridge-react Major
@module-federation/bridge-vue3 Major
@module-federation/bridge-shared Major
@module-federation/bridge-react-webpack-plugin Major
@module-federation/retry-plugin Major
@module-federation/data-prefetch Major
@module-federation/error-codes Major
@module-federation/inject-external-runtime-core-plugin Major
@module-federation/esbuild Patch
@module-federation/runtime-core Patch
@module-federation/utilities Patch
website-new Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claneo claneo marked this pull request as ready for review February 20, 2025 03:42
@2heal1 2heal1 merged commit 5ebc53f into module-federation:main Feb 20, 2025
13 of 14 checks passed
@2heal1 2heal1 mentioned this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants