Conversation
Still need to add tests for this
|
@stefanhengl I couldn't help myself and wrote a little more code which should make this not break anything. |
|
@stefanhengl Thinking about next steps here. I believe this is working. What isn't known if this actually makes a difference.
|
|
I ran a couple of tests and it looks like we are finding too many results. EG a search for EDIT: |
|
Performance looks promissing (4.8x faster). |
|
\o/ |
|
@keegancsmith Shall we roll this out? I think this can be live while we polish it. |
I think writing a test is a minumum before landing. You wanna do that? Also I wonder if we should record running this code path as another Stat (instead of regexpsconsidered). But regexpsconsidered is probably fine. Edit: I do believe this change is safe though, so making it in before branch cut would be awesome. |
👍 |
Not sure. Given the docstring we probably shouldn't count evaluations of the wordMatchTree as regexp. I removed the counter for wordMatchTree. Looking at |
keegancsmith
left a comment
There was a problem hiding this comment.
@stefanhengl I can't approve, but LGTM. Ship it :)
A common search Zoekt gets from Sourcegraph is "\bLITERAL\b". With this PR we avoid the regex engine for these type of queries and provide something faster.
Local benchmarks show that the new code runs 4.8x faster for select queries.
Co-authored-by: @stefanhengl