Skip to content

Exponential parse time with nested and out-of-order attributes #105165

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

Open
jruderman opened this issue Dec 2, 2022 · 0 comments
Open

Exponential parse time with nested and out-of-order attributes #105165

jruderman opened this issue Dec 2, 2022 · 0 comments
Labels
C-bug Category: This is a bug. I-compiletime Issue: Problems and improvements with respect to compile times.

Comments

@jruderman
Copy link
Contributor

Found with a modified fuzz-rustc

Code

#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]
#![a = { #[y] #![x]

Time complexity

Each additional line roughly doubles the time taken to reject the input.

Where it's slow

From -Z time-passes:

  • the slow pass is parse_crate

From sample-head.txt:

Regression

Regression in nightly-2021-09-06, likely from #88257 (@estebank)

Version

rustc 1.67.0-nightly (1eb62b123 2022-11-27)
binary: rustc
commit-hash: 1eb62b1235fd77200e6bd967d70e83c0f2497233
commit-date: 2022-11-27
host: x86_64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

@rustbot label +I-compiletime

@jruderman jruderman added the C-bug Category: This is a bug. label Dec 2, 2022
@rustbot rustbot added the I-compiletime Issue: Problems and improvements with respect to compile times. label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-compiletime Issue: Problems and improvements with respect to compile times.
Projects
None yet
Development

No branches or pull requests

2 participants