-
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
Use an IndexVec to cache queries with index-like key #103808
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 7491dfd1c506a6a76d60665ababe8a151018448d with merge 2e7c76e9d2ca0771983633c6e962d0826c6b2172... |
☀️ Try build successful - checks-actions |
Queued 2e7c76e9d2ca0771983633c6e962d0826c6b2172 with parent 2afca78, future comparison URL. |
Finished benchmarking commit (2e7c76e9d2ca0771983633c6e962d0826c6b2172): comparison URL. Overall result: ✅ improvements - no 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. @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.
|
r? @Aaron1011 |
use rustc_span::symbol::{Ident, Symbol}; | ||
use rustc_span::{Span, DUMMY_SP}; | ||
|
||
/// The `Key` trait controls what types can legally be used as the key | ||
/// for a query. | ||
pub trait Key { | ||
type CacheSelector; |
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.
type CacheSelector; | |
type CacheSelector = DefaultCacheSelector<Self>; |
Seems reasonable to set a default here.
r? compiler |
@bors r+ |
☀️ Test successful - checks-actions |
Help rust-analyzer normalize query return types See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/rustc.20query.20types.20are.20not.20normalized.20since.20recently/near/312686086), since rust-lang#103808, rust analyzer doesn't normalize return types of queries. This is because r-a doesn't support associated type defaults (yet). The easiest fix is to not use associated type defaults (duh), which this PR does. r? `@cjgillot`
Use an IndexVec to cache queries with index-like key Revival of an old idea. Let's see if it has more effect. r? `@ghost`
Revival of an old idea. Let's see if it has more effect.
r? @ghost