-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lookahead with None-delimited group #84130
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. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit eb7b1a1 with merge ce7729406a858c09fb39886aa783593f2f8d2d62... |
let mut i = 0; | ||
let mut token = Token::dummy(); | ||
while i < dist { | ||
token = cursor.next().0; | ||
if matches!( | ||
token.kind, | ||
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) | ||
) { | ||
continue; | ||
} | ||
i += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut i = 0; | |
let mut token = Token::dummy(); | |
while i < dist { | |
token = cursor.next().0; | |
if matches!( | |
token.kind, | |
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) | |
) { | |
continue; | |
} | |
i += 1; | |
} | |
let mut token = Token::dummy(); | |
while dist > 0 { | |
token = cursor.next().0; | |
if !matches!( | |
token.kind, | |
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) | |
) { | |
dist -= 1; | |
} | |
} |
Will this be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks less intuitive to me.
☀️ Try build successful - checks-actions |
Queued ce7729406a858c09fb39886aa783593f2f8d2d62 with parent c18c0ad, future comparison URL. |
Finished benchmarking try commit (ce7729406a858c09fb39886aa783593f2f8d2d62): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit c6d67f8 with merge 2cf9ebe7a46b277e9440ebc9a642932dc0a3f08c... |
☀️ Try build successful - checks-actions |
Queued 2cf9ebe7a46b277e9440ebc9a642932dc0a3f08c with parent d0695c9, future comparison URL. |
Finished benchmarking try commit (2cf9ebe7a46b277e9440ebc9a642932dc0a3f08c): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Apparently, this is a small performance win on a few benchmarks. |
rustc_parse compilation has regressed 10%, which is above the usual noise on that measurement. Is that expected? |
@virtualritz: It should be possible for affected crate authors to request rebuilds by opening issues on https://github.com/rust-lang/docs.rs |
@rustbot modify labels: +regression-from-stable-to-nightly |
Whoops, my bad, it's right there in the PR description. |
Only since a few minutes ago 😉 I edited it |
@bors r+ |
📌 Commit c6d67f8 has been approved by |
@bors p=1 this is breaking a lot of crates |
☀️ Test successful - checks-actions |
@Aaron1011 @petrochenkov @Mark-Simulacrum Looks like the perf run performed after this was merged showed the same regressions in compilation of the same benchmarks as well as compilation of The compilation regressions in the benchmarks might be expected since this is strictly doing more work, but I wonder if we have an idea why this would regress compilation of the |
This reverts commit 29dcf23 because the Rust nightly regression has been fixed. rust-lang/rust#84130
I think I actually have a pretty good sense: that function likely gets duplicated a bunch of times, as it's generic over the looker closure passed in. This PR added a non-trivial chunk of code to it, which is now getting monomorphized a bunch more. I've added to my todo list to investigate whether changing the function to take the looker without monomorphization or outlining a chunk of the code makes sense. |
Fixes #84162, a regression introduced by #82608.