-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: kdy1/par-merge
Are you sure you want to change the base?
Conversation
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2805cfc
to
f33b0bc
Compare
|
|
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.