Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Add an option to process files in parallel with worker processes #274

Closed
walkerburgin opened this issue Jan 19, 2024 · 1 comment · Fixed by #280
Closed

Add an option to process files in parallel with worker processes #274

walkerburgin opened this issue Jan 19, 2024 · 1 comment · Fixed by #280

Comments

@walkerburgin
Copy link
Contributor

It looks like @swc/cli processes files in parallel on the main thread (here). It should be significantly faster to process files using a pool of worker sub-processes. This is straightforward to implement using @swc/core, but it would be really nice to be able to integrate the official CLI into our build system instead of this little custom wrapper.

I tried this out for minification on a large internal project with ~2400 output files:

  • Running the CLI with --sync takes ~3m24s
  • Running the CLI in parallel mode takes ~2m28s
  • Using a pool of 8 worker processes takes ~18s

Is this something the project would consider?

@kdy1
Copy link
Member

kdy1 commented Jan 19, 2024

Yes, of course

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants