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

docs(perf): use swc-loader #6706

Merged
merged 3 commits into from
Aug 26, 2024
Merged

docs(perf): use swc-loader #6706

merged 3 commits into from
Aug 26, 2024

Conversation

scarf005
Copy link
Contributor

@scarf005 scarf005 commented Aug 22, 2024

Summary

  • migrate configuration file to typescript to get editor support
  • use swc-loader, a drop-in webpack babel-loader replacement to improve build speed by ~16%.

Description

method babel-loader (default) swc-loader (new)
with minification 46.22s 38.59s (83% of original)
no minification 42.60s 34.73s (81% of original)
Log
$ yarn docusaurus clear
$ time yarn build --no-minify
   
[INFO] Use `npm run serve` command to test your build locally.
Done in 42.32s.

________________________________________________________
Executed in   42.60 secs    fish           external
   usr time   59.48 secs  861.00 micros   59.48 secs
   sys time    6.54 secs  143.00 micros    6.54 secs

$ yarn docusaurus clear
$ time yarn build
Done in 45.91s.

________________________________________________________
Executed in   46.22 secs    fish           external
   usr time   99.91 secs    0.00 micros   99.91 secs
   sys time    9.69 secs  965.00 micros    9.69 secs

$ yarn docusaurus clear
$ time yarn build --no-minify
Done in 34.43s.

________________________________________________________
Executed in   34.73 secs    fish           external
   usr time   50.03 secs    0.04 millis   50.03 secs
   sys time    4.80 secs    1.17 millis    4.79 secs

$ yarn docusaurus clear
$ time yarn build
Done in 38.30s.

________________________________________________________
Executed in   38.59 secs    fish           external
   usr time   89.68 secs    0.00 micros   89.68 secs
   sys time    7.01 secs  870.00 micros    7.01 secs

Additional context

guides followed:

scarf005 and others added 3 commits August 23, 2024 00:25
around 16% faster (from 45.91s to 38.3s)
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tgodzik tgodzik merged commit 424c00f into scalameta:main Aug 26, 2024
21 of 22 checks passed
@scarf005 scarf005 deleted the docs/use-swc branch August 26, 2024 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants