-
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
Replace QueryStruct
with arrays local to rustc_query_impl
#111808
Conversation
for<'tcx> fn(TyCtxt<'tcx>, &mut QueryKeyStringCache) | ||
] = &[$(query_impl::$name::alloc_self_profile_query_strings),*]; | ||
|
||
const ENCODE_QUERY_RESULTS: &[ |
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.
Could you add a comment saying that those arrays are not indexed per DepKind
, so should only be used for iteration?
Thanks. One nit and r=me. |
&mut CacheEncoder<'_, 'tcx>, | ||
&mut EncodedDepNodeIndex) | ||
> | ||
] = &[$(expand_if_cached!([$($modifiers)*], query_impl::$name::encode_query_results)),*]; |
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 this use item_if_cached
? Like this:
] = &[$(expand_if_cached!([$($modifiers)*], query_impl::$name::encode_query_results)),*]; | |
] = &[$( item_if_cached!([$($modifiers)*], query_impl::$name::encode_query_results, ))*]; |
This will allow to remove the option.
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.
The macro has to expand to a single expression, so it's not quite that simple.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2440cca): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 644.264s -> 643.64s (-0.10%) |
This removes
QueryStruct
and instead uses constant arrays of function pointers fortry_collect_active_jobs
,alloc_self_profile_query_strings
andencode_query_results
. This further decouplesrustc_query_impl
fromrustc_middle
.r? @cjgillot