Skip to content

search: Improve performance of zoektIndexedRepos

Administrator requested to merge zoekt-indexed-repos-perf into main

Created by: efritz

During a hack hour, @keegancsmith and I found that 300ms of global search was being taken by determining which repositories are indexed. This change makes the common case faster and reduces allocations by 98% and wall time by 22% when no branches are specified.

$ benchstat old.txt new.txt
name                   old time/op    new time/op    delta
_zoektIndexedRepos-16     151ms ± 5%     118ms ±16%  -22.22%  (p=0.008 n=5+5)

name                   old alloc/op   new alloc/op   delta
_zoektIndexedRepos-16    33.6MB ± 0%    20.8MB ± 0%  -38.09%  (p=0.008 n=5+5)

name                   old allocs/op  new allocs/op  delta
_zoektIndexedRepos-16      407k ± 0%        7k ± 0%  -98.37%  (p=0.008 n=5+5)

Merge request reports

Loading