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: enable SWC disableAllLints by default to reduce overhead #8275

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

chenjiahan
Copy link
Member

Summary

Enable SWC disableAllLints by default to reduce overhead. We prefer to use ESLint or Biome as a linter rather than run lint rules during the JavaScript transformation.

Ref

Benchmark

  • 10000 modules: 4% faster
hyperfine --warmup 1 --runs 3 'SWC_LINTS=true node --run build:rspack' 'SWC_LINTS=false node --run build:rspack'
Benchmark 1: SWC_LINTS=true node --run build:rspack
  Time (mean ± σ):      2.382 s ±  0.027 s    [User: 4.496 s, System: 9.262 s]
  Range (min … max):    2.359 s …  2.412 s    3 runs

Benchmark 2: SWC_LINTS=false node --run build:rspack
  Time (mean ± σ):      2.300 s ±  0.023 s    [User: 4.232 s, System: 7.237 s]
  Range (min … max):    2.278 s …  2.323 s    3 runs

Summary
  SWC_LINTS=false node --run build:rspack ran
    1.04 ± 0.02 times faster than SWC_LINTS=true node --run build:rspack
  • 10000 big modules: 6% faster
hyperfine --warmup 1 --runs 3 'SWC_LINTS=true node --run build:rspack' 'SWC_LINTS=false node --run build:rspack'
Benchmark 1: SWC_LINTS=true node --run build:rspack
  Time (mean ± σ):      8.726 s ±  0.133 s    [User: 80.865 s, System: 6.063 s]
  Range (min … max):    8.593 s …  8.860 s    3 runs

Benchmark 2: SWC_LINTS=false node --run build:rspack
  Time (mean ± σ):      8.211 s ±  0.067 s    [User: 77.066 s, System: 5.413 s]
  Range (min … max):    8.135 s …  8.262 s    3 runs

Summary
  SWC_LINTS=false node --run build:rspack ran
    1.06 ± 0.02 times faster than SWC_LINTS=true node --run build:rspack

From: https://github.com/hardfist/performance-compare-ng/tree/add-big/apps/10000-big

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Oct 30, 2024
@github-actions github-actions bot added the release: performance release: performance related release(mr only) label Oct 30, 2024
Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit aa054e0
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6722fa08ce85350008034163

@chenjiahan
Copy link
Member Author

!bench

@rspack-bot
Copy link

rspack-bot commented Oct 30, 2024

📝 Benchmark detail: Open

Name Base (2024-10-30 85bb238) Current Change
10000_big_production-mode + exec 48.8 s ± 720 ms 48 s ± 830 ms -1.63 %
10000_development-mode + exec 2.11 s ± 43 ms 2.11 s ± 19 ms -0.12 %
10000_development-mode_hmr + exec 647 ms ± 5.9 ms 638 ms ± 6.2 ms -1.30 %
10000_production-mode + exec 2.67 s ± 33 ms 2.65 s ± 44 ms -0.72 %
arco-pro_development-mode + exec 1.77 s ± 81 ms 1.75 s ± 56 ms -0.85 %
arco-pro_development-mode_hmr + exec 428 ms ± 1.8 ms 429 ms ± 1.1 ms +0.15 %
arco-pro_production-mode + exec 3.18 s ± 73 ms 3.19 s ± 77 ms +0.14 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.28 s ± 79 ms 3.26 s ± 72 ms -0.65 %
threejs_development-mode_10x + exec 1.62 s ± 14 ms 1.62 s ± 15 ms -0.20 %
threejs_development-mode_10x_hmr + exec 774 ms ± 5.9 ms 774 ms ± 7.8 ms +0.06 %
threejs_production-mode_10x + exec 4.99 s ± 19 ms 5.01 s ± 38 ms +0.33 %

@chenjiahan
Copy link
Member Author

!bench

@rspack-bot
Copy link

rspack-bot commented Oct 30, 2024

📝 Benchmark detail: Open

Name Base (2024-10-30 85bb238) Current Change
10000_big_production-mode + exec 48.8 s ± 720 ms 48.4 s ± 1.39 s -0.91 %
10000_development-mode + exec 2.11 s ± 43 ms 2.1 s ± 15 ms -0.28 %
10000_development-mode_hmr + exec 647 ms ± 5.9 ms 642 ms ± 8.1 ms -0.70 %
10000_production-mode + exec 2.67 s ± 33 ms 2.64 s ± 24 ms -1.12 %
arco-pro_development-mode + exec 1.77 s ± 81 ms 1.77 s ± 64 ms -0.23 %
arco-pro_development-mode_hmr + exec 428 ms ± 1.8 ms 428 ms ± 1.4 ms -0.04 %
arco-pro_production-mode + exec 3.18 s ± 73 ms 3.18 s ± 89 ms -0.26 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.28 s ± 79 ms 3.22 s ± 62 ms -1.87 %
threejs_development-mode_10x + exec 1.62 s ± 14 ms 1.62 s ± 13 ms +0.11 %
threejs_development-mode_10x_hmr + exec 774 ms ± 5.9 ms 774 ms ± 9.2 ms +0.05 %
threejs_production-mode_10x + exec 4.99 s ± 19 ms 5.01 s ± 24 ms +0.44 %

hardfist
hardfist previously approved these changes Oct 31, 2024
@chenjiahan chenjiahan merged commit 79971ff into main Oct 31, 2024
29 checks passed
@chenjiahan chenjiahan deleted the disable_swc_lints_1030 branch October 31, 2024 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants