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.: Implement "eval-always" queries #45238

Closed
michaelwoerister opened this issue Oct 12, 2017 · 4 comments
Closed

incr.comp.: Implement "eval-always" queries #45238

michaelwoerister opened this issue Oct 12, 2017 · 4 comments
Labels
A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-incr-comp Working group: Incremental compilation

Comments

@michaelwoerister
Copy link
Member

For each query invocation the query system will track which other queries have been invoked by the former. We collect this data in the DepGraph and use it to find which queries need to be re-executed in a subsequent compilation session. However, there are some queries (like collect_and_partition_translation_items for example) that access pretty much everything in the current crate and therefore:

  • will introduce a lot of dependency edges in the graph, while at the same time
  • are very likely to be re-executed if there is even a small change to the code base.

We can take advantage of this domain knowledge by introducing so-called "eval-always" queries. This is a special kind of query where we opt into super coarse-grained dependency tracking: Instead of recording each individual read-edge, we just record a single read to DepNode::Krate. This has the effect that any change will make this query be re-executed.

Note that it is not entirely clear how much of a performance win this can provide but it's certainly interesting to test out.

There are a few steps to implementing this:

Feel free to come up with a better name for "eval-always". It's really not a good name :)

cc @wesleywiser @nikomatsakis

@michaelwoerister michaelwoerister added A-incr-comp Area: Incremental compilation E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-incr-comp Working group: Incremental compilation labels Oct 12, 2017
@nikomatsakis
Copy link
Contributor

Some other queries for which eval-always might be useful:

  • crate_variances
  • variances_of
  • crate_inherent_impls
  • inherent_impls
  • crate_inherent_impls_overlap_check

@wesleywiser
Copy link
Member

I'm working on this.

@TimNN TimNN added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Oct 17, 2017
@wesleywiser
Copy link
Member

I've pushed up a commit for review that implements the first two parts of this. I'd like to get some feedback on that and make sure I'm doing this correctly before continuing with the rest. I called these queries "untracked queries" instead of "eval always queries". If you like the other name better, I'd be happy to change it.

@michaelwoerister
Copy link
Member Author

Thank you, @wesleywiser! I'll comment on the PR.

wesleywiser added a commit to wesleywiser/rust that referenced this issue Oct 26, 2017
wesleywiser added a commit to wesleywiser/rust that referenced this issue Oct 26, 2017
wesleywiser added a commit to wesleywiser/rust that referenced this issue Oct 26, 2017
bors added a commit that referenced this issue Oct 27, 2017
[incremental] Add support for eval always queries

Part of #45238
@bors bors closed this as completed in 8281e88 Oct 27, 2017
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. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-incr-comp Working group: Incremental compilation
Projects
None yet
Development

No branches or pull requests

4 participants