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

incr.comp.: Load dep-graph in the background #46555

Closed
michaelwoerister opened this issue Dec 7, 2017 · 2 comments
Closed

incr.comp.: Load dep-graph in the background #46555

michaelwoerister opened this issue Dec 7, 2017 · 2 comments
Labels
A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. WG-incr-comp Working group: Incremental compilation

Comments

@michaelwoerister
Copy link
Member

The dependency graph is loaded at the earliest point possibly during the compilation session (after the crate disambiguator has been set):

let dep_graph = if sess.opts.build_dep_graph() {

However, it is only needed for the first time a few passes later:

let hir_crate = lower_crate(sess, cstore, &dep_graph, &krate, &mut resolver);

This was intentional so that we have to possibility to load and decode it the graph on a background thread. One way to implement this is to make rustc_incremental::load_dep_graph() start a new thread and return the thread::JoinHandle and then only join that thread right before the dep-graph is actually needed.

@michaelwoerister michaelwoerister added A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. WG-incr-comp Working group: Incremental compilation labels Dec 7, 2017
@Yoric
Copy link
Contributor

Yoric commented Dec 7, 2017

I'll try and do that.

@michaelwoerister
Copy link
Member Author

@Yoric Cool, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. WG-incr-comp Working group: Incremental compilation
Projects
None yet
Development

No branches or pull requests

2 participants