Benchmark in-memory, index-only search
Created by: mrnugget
This adds a benchmark for searchResolver.Results()
that uses as few mocks as possible.
In order to make this benchmark possible, we had to change the code to allow for the injection of *searchbackend.Zoekt
into the resolver. This removes a lot of calls to the global IndexedSearch()
function and replaces them either with accesses to the injected r.zoekt
attribute.
It also includes one quick performance improvement that reduces memory allocations by roughly ~30%
Test plan: go test ./...