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

Regex performance regression from 4.8.12 to 4.8.13 #5693

Closed
ahelwer opened this issue Dec 4, 2021 · 3 comments
Closed

Regex performance regression from 4.8.12 to 4.8.13 #5693

ahelwer opened this issue Dec 4, 2021 · 3 comments
Assignees

Comments

@ahelwer
Copy link
Contributor

ahelwer commented Dec 4, 2021

This concerns comparing the regexes (ab)*a(ab)*a and a(ba)*a(ba)* (doubled versions of (ab)*a and a(ba)*). 4.8.12 compares them almost instantaneously (even handling tripled versions) but on 4.8.13 and the 12/1/2021 nightly build it times out, running for up to 6 hours (discovered with a github action test runner timing out). Here is python code to reproduce:

from z3 import *

a = Re('a')
b = Re('b')
r1 = Concat(a, Star(Concat(b, a))) # a(ba)*
r1 = Concat(r1, r1)
r2 = Concat(Star(Concat(a, b)), a) # (ab)*a
r2 = Concat(r2, r2)

s = Solver()
s.add(Distinct(r1, r2))
print(s.check())
@NikolajBjorner
Copy link
Contributor

@ahelwer - could you collect these benchmarks as SMTLIB2 (use print(s.sexpr() + "\n(check-sat)\n")) and submit them to the z3test repository? This makes it easier to catch regressions relevant to your use case.

NikolajBjorner pushed a commit to Z3Prover/z3test that referenced this issue Dec 9, 2021
@NikolajBjorner
Copy link
Contributor

@NikolajBjorner
Copy link
Contributor

it is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants