-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Construct query job latches on-demand #68693
Conversation
@bors try |
⌛ Trying commit aa0abc80119e8bb3b5f2f104b17b19a289a95121 with merge 38be9357b39a77cd206eab30844c05a019dc72f3... |
@bors try @rust-timer queue |
Awaiting bors try build completion |
[WIP] Construct query job latches on-demand r? @michaelwoerister
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☀️ Try build successful - checks-azure |
Queued 7ccaf1c with parent 266ecd6, future comparison URL. |
Finished benchmarking try commit 7ccaf1c, comparison URL. |
The idea here is to avoid creating a A We can no longer refer to queries using |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit f52b65c85a861033e46576cf9853683c6ba47ff8 with merge 89c6ff362254e2735d7304447a89dca0f130da31... |
☀️ Try build successful - checks-azure |
Queued 89c6ff362254e2735d7304447a89dca0f130da31 with parent cd1ef39, future comparison URL. |
The performance numbers look good. I'll try to make time for reviewing this some time this or next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally in favor of going forward with this. It's a good idea to move some of the more expensive operations out of the fast-path. I have one main concern that I listed below.
src/librustc/ty/query/plumbing.rs
Outdated
@@ -139,39 +149,54 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> { | |||
query_blocked_prof_timer = Some(tcx.prof.query_blocked()); | |||
} | |||
|
|||
job.clone() | |||
// Create the id of the job we're waiting for | |||
let id = QueryJobId { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind creating a helper method for this? This function is already rather big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/librustc/ty/query/plumbing.rs
Outdated
key: &Q::Key, | ||
token: QueryToken, | ||
) -> TryGetJob<'a, 'tcx, Q> { | ||
pub(super) fn try_get(tcx: TyCtxt<'tcx>, span: Span, key: &Q::Key) -> TryGetJob<'a, 'tcx, Q> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how token
disappears from the function signature again.
📌 Commit 5206827 has been approved by |
Construct query job latches on-demand r? @michaelwoerister
💔 Test failed - checks-azure |
@bors retry |
@bors p=1 |
Construct query job latches on-demand r? @michaelwoerister
☀️ Test successful - checks-azure |
📣 Toolstate changed by #68693! Tested on commit 21ed505. 💔 rustc-guide on linux: test-pass → test-fail (cc @JohnTitor @amanjeev @spastorino @mark-i-m, @rust-lang/infra). |
Tested on commit rust-lang/rust@21ed505. Direct link to PR: <rust-lang/rust#68693> 💔 rustc-guide on linux: test-pass → test-fail (cc @JohnTitor @amanjeev @spastorino @mark-i-m, @rust-lang/infra).
r? @michaelwoerister