-
Notifications
You must be signed in to change notification settings - Fork 49
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
Slow match and crash for single-error strings #65
Comments
this is something that has come up multiple times, but i'm not sure whether the lib should address this, or the user should. for needles that look like copy-pasted things, just falling back to exact substring match is probably the way to go. there's already a similar guard behavior to prevent maybe there should be a default threshold of 25 chars or something (whatever is reasonable to type by hand). generally i'm not a huge fan of search behavior changing silently, but it's probably better than the current situation. |
I can appreciate that this is a hard thing to have a default for. Is the recommendation just to bail out of using ufuzzy in the case of long needles? Even if the fallback isn't built in it may be nice for ufuzzy to provide a mode that produces |
my recommendation is to use another uFuzzy instance configured with however, uFuzzy has no way of making a term optional. they're all required. so even in |
I am not sure what specifically is causing the regex to take such a long time to match, and the example is somewhat contrived, but this did happen to us when trying to get match info from a small list of google places. The problem in this case was easily avoided by using googles metadata but I can imagine that this can happen elsewhere:
https://codepen.io/jquense/pen/GRaKqwv
The text was updated successfully, but these errors were encountered: