Skip to content

perf: rewrite search regexes to make all groups non-capturing

Created by: keegancsmith

The go regex engine is much faster at running a regex when a group is non-capturing. Given both searcher and zoekt never do captures, we can rewrite any regex we run to ensure all groups are non-capturing.

I've labelled this as a good first issue since in general work like this requires a focussed change (just doing some work with go's regexp/syntax) and the places to change in the code are very targetted in both zoekt and searcher.

For more context see https://github.com/sourcegraph/sourcegraph/pull/34683 and https://app.slack.com/client/T02FSM7DL/C020S8AT3LN/thread/C020S8AT3LN-1651194738.322429