Skip to content

graphqlbackend: run excluded repos concurrently with Repos.List

Administrator requested to merge k/repo-list-concurrent into main

Created by: keegancsmith

resolveRepositories is on the critical path of serving a search request. It does two calls to db.Repos.Count and one call to db.Repos.List. Each of those calls takes about the same amount of time and are independent of each other. This commit runs them concurrently since this is a significant portion of a search request time.

For example on Sourcegraph.com searching "repo:google foobarbaz" has resolveRepositories take ~400ms of which each Count/List operation takes ~125ms. The overall search time is ~800ms, so this is a ~30% improvement.

Co-Author: Stefan

Merge request reports

Loading