-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Comments
Some other queries for which eval-always might be useful:
|
I'm working on this. |
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. |
Thank you, @wesleywiser! I'll comment on the PR. |
[incremental] Add support for eval always queries Part of #45238
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 (likecollect_and_partition_translation_items
for example) that access pretty much everything in the current crate and therefore: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:
OpenTask::Ignore
infn read_index
but, upon closing, registers a read toDepNode::Krate
.DepGraph::with_eval_always_task()
.DepKind
/DepNode
as "eval_always", the same way it is possible to mark them asanon
orinput
.fn try_get_with()
in https://github.com/rust-lang/rust/blob/master/src/librustc/ty/maps/plumbing.rs check of theDepNode
being "eval_always" and if true, executecompute_result
withinDepGraph::with_eval_always_task()
(very similar to theanon
case)collect_and_partition_translation_items
lint_levels
privacy_access_levels
(and removewith_ignore
fromlibrustc_privacy::check_crate
)Feel free to come up with a better name for "eval-always". It's really not a good name
:)
cc @wesleywiser @nikomatsakis
The text was updated successfully, but these errors were encountered: