-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Description
Now, when code needs to look up attributes on an item, it fetches the complete list of attributes and sequentially looks for the interesting one. This could be made more efficient by making the attribute list a SortedIndexMultiMap
.
Steps:
- replace
&[ast::Attribute]
bySortedIndexMultiMap<u32, Symbol, &ast::Attribute>
inrustc_hir::hir
,rustc_middle::query
andrustc_middle::ty
; - build the
SortedIndexMultiMap
inrustc_ast_lowering
andrustc_metadata::decoder
usingAttribute::name_or_empty
as key; - adapt the use sites to fetch the attributes using
attrs.get_by_key(my_name)
instead ofattrs.iter().filter(|attr| attr.has_name(my_name)
; - evaluate performance impact.
Extra:
- implement
item_attrs
query for the local crate, and replace calls totcx.get_attrs
by calls totcx.item_attrs
.
I am available on zulip for more detailed information.
Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.