-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make associated item collection a query #68837
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
Make associated item collection a query Before this change, every time associated items were iterated over (which rustc does *a lot* – this can probably be further optimized), there would be N+1 queries to fetch all assoc. items. Now there's just one after they've been computed once.
r=me after timer's done |
☀️ Try build successful - checks-azure |
Queued 694e0b9 with parent c9290dc, future comparison URL. |
Finished benchmarking try commit 694e0b9, comparison URL. |
Some pretty nice improvements in packed-simd, and no real regressions. Nice. @bors r=estebank |
📌 Commit 4fc4b95 has been approved by |
cc @eddyb I recall an issue you filed a while back about something like this |
@@ -310,6 +310,11 @@ rustc_queries! { | |||
/// Maps from a trait item to the trait item "descriptor". | |||
query associated_item(_: DefId) -> ty::AssocItem {} | |||
|
|||
/// Collects the associated items defined on a trait or impl. | |||
query associated_items(key: DefId) -> ty::AssocItemsIterator<'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.
Could this be just the slice? You might need to replace this:
for x in tcx.associated_items(def_id)
with:
for &x in tcx.associated_items(def_id)
But for the most part it should be fine not to even do that.
@Mark-Simulacrum I don't recall, maybe it wasn't me. cc @nikomatsakis |
…, r=estebank Make associated item collection a query Before this change, every time associated items were iterated over (which rustc does *a lot* – this can probably be further optimized), there would be N+1 queries to fetch all assoc. items. Now there's just one after they've been computed once.
Rollup of 9 pull requests Successful merges: - #68691 (Remove `RefCell` usage from `ObligationForest`.) - #68751 (Implement `unused_parens` for `const` and `static` items) - #68788 (Towards unified `fn` grammar) - #68837 (Make associated item collection a query) - #68842 (or_patterns: add regression test for #68785) - #68844 (use def_path_str for missing_debug_impls message) - #68845 (stop using BytePos for computing spans in librustc_parse/parser/mod.rs) - #68869 (clean up E0271 explanation) - #68880 (Forbid using `0` as issue number) Failed merges: r? @ghost
Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in #68837 (comment).
…=petrochenkov Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in rust-lang#68837 (comment).
…=petrochenkov Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in rust-lang#68837 (comment).
…=petrochenkov Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in rust-lang#68837 (comment).
Before this change, every time associated items were iterated over (which rustc does a lot – this can probably be further optimized), there would be N+1 queries to fetch all assoc. items. Now there's just one after they've been computed once.