Skip to content
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

Disable StressTestDeepNestingOfLoops for NonBacktracking engine #87369

Merged
merged 5 commits into from
Jun 13, 2023

Conversation

danmoseley
Copy link
Member

Relates to #84188

I ran this for over 30 mins and it still didn't complete.

@ghost
Copy link

ghost commented Jun 10, 2023

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

Relates to #84188

I ran this for over 30 mins and it still didn't complete.

Author: danmoseley
Assignees: danmoseley
Labels:

area-System.Text.RegularExpressions

Milestone: -

@stephentoub
Copy link
Member

cc: @olsaarik

@danmoseley
Copy link
Member Author

danmoseley commented Jun 11, 2023

It's just yield return new object[] { engine, "(", "a", ")*", "a", 2000, 1000 }; that is pathological.

pattern repetition input repetition Interpreted Compiled NonBacktracking
1 1000 0.01 0.18 0.29
10 1000 0.019 0.32
20 1000 0.011 0.0012 > 60s
40 1000 0.011 0.001 > 60s
2000 1000 0.39 0.37 > 60s
2000 10 0.39 0.36 10.8
2000 1 0.38 0.37 10.7

On the other two variants, NonBacktracking takes less than a second (but still slower than the others)

@stephentoub
Copy link
Member

Can we just put an if around that one case then?

@danmoseley
Copy link
Member Author

done

@danmoseley danmoseley changed the title Disable StressTestDeepNestingOfLoops for NonBacktracking engine NonBacktracking engine is pathologically slow on patterns like "((((((((a)*)*)*)*)*)*)*" and input like "aaaaaaa" which other engines handle fine Jun 11, 2023
@danmoseley danmoseley changed the title NonBacktracking engine is pathologically slow on patterns like "((((((((a)*)*)*)*)*)*)*" and input like "aaaaaaa" which other engines handle fine Disable StressTestDeepNestingOfLoops for NonBacktracking engine Jun 11, 2023
@danmoseley
Copy link
Member Author

feedback addressed

@stephentoub stephentoub merged commit 8d0b619 into dotnet:main Jun 13, 2023
@stephentoub
Copy link
Member

Thanks

@ghost ghost locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants