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

[parallel-queries] Refactor away DepGraph::work_products to avoid shared mutable state #50500

Closed
michaelwoerister opened this issue May 7, 2018 · 1 comment
Labels
A-parallel-queries Area: Parallel query execution C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-compiler-performance Working group: Compiler Performance

Comments

@michaelwoerister
Copy link
Member

DepGraph::work_products is a field that collects the object files cached during the current compilation session. This information (probably) does not need to live in the dep-graph as shared mutable state. Instead the information could be threaded through via return values and function parameters. An initial analysis suggest that the following functions need to be modified:

  • rustc_incremental::persist::work_product::save_trans_partition()
  • librustc_trans::back::write::copy_module_artifacts_into_incr_comp_cache()
  • librustc_trans::back::write::OngoingCrateTranslation::join()
  • rustc_incremental::persist::save::save_work_products()

cc @rust-lang/wg-compiler-performance

@michaelwoerister michaelwoerister added C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-compiler-performance Working group: Compiler Performance A-parallel-queries Area: Parallel query execution labels May 7, 2018
alexcrichton added a commit to alexcrichton/rust that referenced this issue May 11, 2018
…ster

Remove all reference to DepGraph::work_products

This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.

I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.

r? @michaelwoerister
kennytm added a commit to kennytm/rust that referenced this issue May 12, 2018
…ster

Remove all reference to DepGraph::work_products

This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.

I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.

r? @michaelwoerister
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 12, 2018
…ster

Remove all reference to DepGraph::work_products

This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.

I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.

r? @michaelwoerister
@michaelwoerister
Copy link
Member Author

Fixed by #50558.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parallel-queries Area: Parallel query execution C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-compiler-performance Working group: Compiler Performance
Projects
None yet
Development

No branches or pull requests

1 participant