Optimize nonstandard_macro_braces by 99.9683% [1.1b -> 351K] - #16808
Conversation
|
r? @dswij rustbot has assigned @dswij. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Lintcheck changes for 5f34b6d
This comment will be updated if you push new changes |
|
I didn't notice those lintcheck differences, I'll fix them |
This comment has been minimized.
This comment has been minimized.
efddb12 to
4a457cc
Compare
This comment has been minimized.
This comment has been minimized.
4a457cc to
643b54f
Compare
There was a problem hiding this comment.
Awesome work! Left some comments, mostly stylistic
Let me take over the review if that's okay
r? @ada4a
This comment has been minimized.
This comment has been minimized.
61386b9 to
54496c9
Compare
This comment has been minimized.
This comment has been minimized.
3631298 to
a7406b6
Compare
This comment has been minimized.
This comment has been minimized.
a7406b6 to
86c00a2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d8d7901 to
489bf44
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
0fdca09 to
c00ffe5
Compare
| mod unnecessary_clippy_cfg; | ||
| mod useless_attribute; | ||
| mod utils; | ||
|
|
There was a problem hiding this comment.
this looks spurious.. could you please remove this change?
There was a problem hiding this comment.
Done, I've also squashed
b3b24d4 to
5f34b6d
Compare
View all comments
I know that we shouldn't move lints to pre-expansion, but
nonstandard_macro_braceswas taking up almost a 25% of the Clippy-exclusive runtime inwasmi-0.35.0, and moving it to pre-expansion lets us not bother as much with expansion data.Previously, we had to get expansion data via
outer_expn_data, which does atomic operations,SessionGlobalsoperations (so, locking threads), and was generally a very bumpy way of doing things. For example inwasmiwe were callingscoped_tls::ScopedKey<rustc_span::SessionGlobals>::with<<rustc_span::hygiene::HygieneData>::with<rustc_span::hygiene::ExpnData, <rustc_span::hygiene::SyntaxContext>::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData>5,879,804 times. Thus locking the thread 11,759,608 times.So personally I think that moving this lint to pre-expansion is worth.
changelog:[
nonstandard_macro_braces]: Optimize by 99.97%