Make associated item collection a query#68837
Make associated item collection a query#68837bors merged 1 commit intorust-lang:masterfrom jonas-schievink:assoc-item-lookup-2
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 |
| 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.
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.