Completely resolve indexed search performance regression in v3.2.0
Created by: slimsag
In #3685 I resolved a major indexed search performance regression that was introduced in v3.2.0.
For a search returning 100 repositories and 100 results per repository:
-
After the regression: we would do 100*100 == 10,000 Git OID resolutions (which would overload Gitserver and cause searches to timeout)
-
After my previous resolution, we would no longer do duplicate work and thus only did 100 Git OID resolutions (1 per repository).
- This was shown in benchmarks and load tests on customer instances to be a substantial improvement.
- On one customer instance, we've found this still hasn't been enough of an improvement.
- On another customer instance, we've found we could be doing better.
-
After this resolution, we are 100% at the performance level we were at prior to v3.2.0 because we are no longer doing any additional Git OID resolutions. Zoekt already has this information and we already acquire this information prior to executing searches, we just weren't correctly reusing this information. Just goes to show that doing things the right way the first time around is incredibly important.
- Likely to fully resolve an outstanding issue that https://app.hubspot.com/contacts/2762526/company/464956351 is facing.
- Will help https://app.hubspot.com/contacts/2762526/company/407948923 and all other customers using indexed search.
- Fixes #3750 (closed)
Test plan: Both manual testing and automated testing from existing search Go tests.