-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Attributes are parsed twice #143940
Copy link
Copy link
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
All attributes, both using the old and new parsing infrastructure are currently parsed (at least) twice
rust/compiler/rustc_attr_parsing/src/context.rs
Line 616 in cccf075
#[cfg]was one of the only attributes that was only parsed once. When we ported #[cfg] the the new parsing infrastructure (#143460), we sadly had to also parse it twice, losing around ~0.2% performance on some benchmarks.This suggests that if we can merge these checks into the new attribute parser we can gain quite a bit of performance. We should do this.
cc @jdonszelmann