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

bug: adding shellstyle patterns can burn time and memory #67

Closed
timbray opened this issue Jun 14, 2022 · 3 comments · Fixed by #77
Closed

bug: adding shellstyle patterns can burn time and memory #67

timbray opened this issue Jun 14, 2022 · 3 comments · Fixed by #77

Comments

@timbray
Copy link
Owner

timbray commented Jun 14, 2022

If you add a sequence of random shellstyle patterns Quamina quickly starts generating huge automata and AddPattern starts slowing down dramatically to the point where it's basically unusable.

My test words that produced this effect: "aahed*", "aalii", "aargh", "aarti*", "abaca", "abaci", "aback", "abacs", "abaft", "abaka", "abamp", "aband", "abase", "abash", "abask", "abate", "abaya", "abbas", "abbed*", "ab*bes"

@embano1
Copy link
Collaborator

embano1 commented Jun 14, 2022

Sounds like a good candidate to add some Fuzz testing with timeout detection to Quamina at some point? https://go.dev/doc/fuzz/

@timbray
Copy link
Owner Author

timbray commented Jun 23, 2022

Yes on fuzzing. Ouch, this one is really beating me up, we may end up running into a fundamental computer-science issue here and just say that combining a lot of wildcards makes AddPattern() expensive in both time and memory. But haven't given up yet.

@embano1
Copy link
Collaborator

embano1 commented Jun 27, 2022

Fair enough Tim, there‘s always a cost and at least if users are aware of penalties, IMHO that‘s fine for now.

timbray added a commit that referenced this issue Jun 28, 2022
Closes: #67
Signed-off-by: Tim Bray <tbray@textuality.com>
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

Successfully merging a pull request may close this issue.

2 participants