-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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::queryandrustc_middle::ty; - build the
SortedIndexMultiMapinrustc_ast_loweringandrustc_metadata::decoderusingAttribute::name_or_emptyas 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_attrsquery for the local crate, and replace calls totcx.get_attrsby 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.