-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
try and simplify some things in the query system #100436
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
fa3df6c
to
09a56fd
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 09a56fd69bee9590d20526a447b8879c68a1b42e with merge b4e3257899c45300440fd556ce4d3bf0517ee057... |
☀️ Try build successful - checks-actions |
Queued b4e3257899c45300440fd556ce4d3bf0517ee057 with parent b998821, future comparison URL. |
Finished benchmarking commit (b4e3257899c45300440fd556ce4d3bf0517ee057): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
@@ -143,7 +143,7 @@ impl DepKind { | |||
} | |||
|
|||
macro_rules! define_dep_nodes { | |||
(<$tcx:tt> | |||
(//<$tcx:tt> |
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.
Comment should be removed
@@ -179,7 +179,7 @@ macro_rules! define_dep_nodes { | |||
); | |||
} | |||
|
|||
rustc_dep_node_append!([define_dep_nodes!][ <'tcx> | |||
rustc_dep_node_append!([define_dep_nodes!][ //<'tcx> |
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.
Same
@@ -306,7 +306,7 @@ pub fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) { | |||
let mut string_cache = QueryKeyStringCache::new(); | |||
|
|||
macro_rules! alloc_once { | |||
(<$tcx:tt> | |||
(//<$tcx:tt> |
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.
Same
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.
r=me with one nit and commented out code removed.
Marking as part of #96524 because of the change on make_query
module.
opt_remap_env_constness!([$($modifiers)*][key]); | ||
let kind = dep_graph::DepKind::$name; | ||
let name = stringify!($name); | ||
fn create_query_frame<'tcx, K: Copy + Key + for<'a> HashStable<StableHashingContext<'a>>>(tcx: QueryCtxt<'tcx>, do_describe: fn(QueryCtxt<'tcx>, K) -> String, key: K, kind: DepKind, name: &'static str) -> QueryStackFrame { |
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.
Can you move this outside the macro?
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.
good idea, done :) had to rearrange a bunch of imports because define_queries
is expanded in the crate root; always confuses me that those are different. I'll see if I can make that the same in a follow-up PR actually.
r? @cjgillot |
09a56fd
to
bf77d94
Compare
It's not actually necessary and it makes the code harder to read.
Rustdoc documents these with the name of the type alias instead of normalizing them to the underlying type. Use associated types instead so that the generated docs for nightly-rustc are easier to read.
bf77d94
to
c6c5bf7
Compare
@bors r=cjgillot rollup=never (very perf-sensitive) |
📌 Commit c6c5bf7cf262d7e86f75ba312ba0e5efe01eeb77 has been approved by It is now in the queue for this repository. |
@bors r- |
This should both make the code easier to read and also greatly reduce the amount of codegen the compiler has to do, since it only needs to monomorphize `create_query_frame` for each new key and not for each query.
c6c5bf7
to
e188868
Compare
@bors r=cjgillot rollup=never (very perf-sensitive) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (76531be): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Simplify the arguments to macros generated by the `rustc_queries` proc macro Very small cleanup. Based on rust-lang#100436 which modifies some of the same code. r? `@cjgillot`
No description provided.