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(es/minifier): Make DCE analyzer parallel #10076

Draft
wants to merge 32 commits into
base: kdy1/par-merge
Choose a base branch
from
Draft

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 21, 2025

Description:

The analyzer of the DCE pass can be parallelized in a similar way to mark-sweep GC. It currently uses &mut petgraph::DiGraphMap to find reachable bindings, but we can split the graph creation into multiple threads.

Also, I decided to amort allocations because swc_parallel::join is called an enormous amount of time, meaning that it will be slower if I allocate one hashmap from each closure. I'll use thread_local crate to reuse the hashmap and collect all of them after the traversal is done.

Copy link
Member Author

kdy1 commented Feb 21, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kdy1 kdy1 added this to the Planned milestone Feb 21, 2025
@kdy1 kdy1 changed the base branch from kdy1/par-merge to graphite-base/10076 February 21, 2025 04:59
@kdy1 kdy1 force-pushed the graphite-base/10076 branch from 2805cfc to f33b0bc Compare February 21, 2025 04:59
@kdy1 kdy1 changed the base branch from graphite-base/10076 to main February 21, 2025 04:59
Copy link

changeset-bot bot commented Feb 21, 2025

⚠️ No Changeset found

Latest commit: 64e308b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

Copy link

changeset-bot bot commented Feb 21, 2025

⚠️ No Changeset found

Latest commit: 6f16e73

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@kdy1 kdy1 changed the base branch from main to graphite-base/10076 February 21, 2025 05:02
@kdy1 kdy1 changed the base branch from graphite-base/10076 to kdy1/par-merge February 21, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant