-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Get rid of rustc_query_description!
#102895
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 6042ea72275fb466660bbdde8777dc7d6540e84b with merge 755919a27fb7a6a1ee85bc2810a3ec36c41099c6... |
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.
Thanks @Nilstrieb. I think this goes in the right direction.
} | ||
|
||
#[inline] | ||
fn cache_on_disk(tcx: TyCtxt<'tcx>, key: &Self::Key) -> bool { |
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.
cache_on_disk
is typically very small and never used in rustc_query_system
. I'd like to remove it from the trait too, if possible. It's used in try_load_from_on_disk_cache
, so it's a bit more complex as a refactor.
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.
Doing this in a not-cursed way (I have several cursed ideas involving conjuring up generic fn defs using transmute(())
) requires a few more refactors than I'd like to do here, so I'd prefer doing that in a follow-up PR.
☀️ Try build successful - checks-actions |
Queued 755919a27fb7a6a1ee85bc2810a3ec36c41099c6 with parent 0265a3e, future comparison URL. |
Finished benchmarking commit (755919a27fb7a6a1ee85bc2810a3ec36c41099c6): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never 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 |
I implemented most of the fixes, but I haven't investigated the perf regressions for diesel. Maybe another perf run will make them magically go away after my fixes? 🙂 |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 4ae32c8cca22265c5c3ea8c2b751a251f53f97ed with merge cce71dc4adbb716bd87c9a5208f331d6cbfc7382... |
☀️ Try build successful - checks-actions |
Queued cce71dc4adbb716bd87c9a5208f331d6cbfc7382 with parent 6b3ede3, future comparison URL. |
Finished benchmarking commit (cce71dc4adbb716bd87c9a5208f331d6cbfc7382): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never 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 |
And they did magically go away and some even turned into improvements, very nice. |
Great. We will see about the |
📌 Commit 4ae32c8cca22265c5c3ea8c2b751a251f53f97ed has been approved by It is now in the queue for this repository. |
⌛ Testing commit 4ae32c8cca22265c5c3ea8c2b751a251f53f97ed with merge f18001a215707d9635b0865ec00b420dc96c0d7a... |
💔 Test failed - checks-actions |
4ae32c8
to
1624187
Compare
Queries can provide an arbitrary expression for their description and their caching behavior. Before, these expressions where stored in a `rustc_query_description` macro emitted by the `rustc_queries` macro, and then used in `rustc_query_impl` to fill out the methods for the `QueryDescription` trait. Instead, we now emit two new modules from `rustc_queries` containing the functions with the expressions. `rustc_query_impl` calls these functions now instead of invoking the macro. Since we are now defining some of the functions in `rustc_middle::query`, we now need all the imports for the key types there as well.
It was called directly already, but now it's even more useless since it just forwards to the free function. Call it directly.
1624187
to
24ce4cf
Compare
I rebased the commits and tried running the rustdoc-gui tests locally (which for some reason fail here even though I touched nothing relevant to it??). Some tests failed locally but after a few retries they all passed. Are the rustdoc-gui tests that flaky? Anyways, this seems to be a spurious error and not the fault of this PR |
This comment has been minimized.
This comment has been minimized.
@bors retry |
@bors r=cjgillot |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b8c35ca): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @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 |
I am not entirely sure whether this is an improvement and would like to get your feedback on it.
Helps with #96524.
Queries can provide an arbitrary expression for their description and their caching behavior. Before, these expressions where stored in a
rustc_query_description
macro emitted by therustc_queries
macro, and then used inrustc_query_impl
to fill out the methods for theQueryDescription
trait.Instead, we now emit two new modules from
rustc_queries
containing the functions with the expressions.rustc_query_impl
calls these functions now instead of invoking the macro.Since we are now defining some of the functions in
rustc_middle::query
, we now need all the imports for the key types mthere as well.r? @cjgillot