repo-updater: Tune pagination params in Store
Created by: tsenart
This commit introduces Limit
and Page
parameters on
StoreListReposArgs
which allow callers to specify the page size and
the total limit of returned repos by ListRepos
.
Additionally, it also changes the default page size from 500 to 10000. The reason for this is that in most configurations, the network roundtrip and marshalling overhead dominates the total time taken to list the desired number of repositories.
The value of 10000 has been empirically found with a helper program
that listed repos in sourcegraph.com with different Limit
and Page
parameters.
- Page=500 Limit=20000: 15.699724879s
- Page=5000 Limit=20000: 3.924060726s
- Page=10000 Limit=20000: 1.106930741s
- Page=20000 Limit=20000: 3.208471686s
This should fix one part of the performance regressions reported by @slimsag yesterday.