zoekt: binary encoder for repo branches
Created by: keegancsmith
This updates zoekt to include a custom binary marshaller for repo branches. When CPU profiling two of the major contributors is Gob encoding and garbage collection. This should significantly improve time spent gob encoding (~4x faster). It also will only allocate one large buffer vs 2 per key, value in gob. This should help reduce pressure on frontend.
For example on Sourcegraph.com we have 100k repos indexed with 12 search replicas. This means when marshalling the repobranches for default we will go from allocating 100k * 2 * 12 = 2.4 million objects to 12.
This commit requires zoekt and sourcegraph-frontend to have the same version of query.RepoBranches. For customers this will require a small amount of downtime when upgrading. For sourcegraph.com I will ensure they roll out at the same time.
Changes:
- https://github.com/sourcegraph/zoekt/pull/54 shards: optimize RepoBranches when all branches are the same
- https://github.com/sourcegraph/zoekt/pull/53 query: binary encoder for repo branches
- https://github.com/sourcegraph/zoekt/commit/2a821ee query: exactly match on repobranch branches