Skip to content

Structural search: return early when prefiltering returns no results

Warren Gifford requested to merge cc/comby-exit-early into main

Created by: camdencheek

This adds an early return to filteredStructuralSearch when we return no matches from regexSearchBatch. Before this, we would continue to do a structural search on the repo with an empty string, which is apparently interpreted by Comby as "search everything", which was causing unindexed searches to take far more resources than they needed to.

Locally, this makes the query repo:.* rev:HEAD~ strcmp(argv[...], ...) count:all go from timing out at 20 seconds to taking 1.5 seconds.

Test plan

Unit tests

Merge request reports

Loading