Skip to content

gitserver: periodically run git gc

Created by: keegancsmith

We currently rely on "recloning" to keep garbage under control in git repos. IE offload the expensive work to the codehost. Also has a benefit of anything weird that happens, we will have a fresh clone every X days. However, I think the time has come to invest in a smarter approach of running "git gc" on popular repos during quite times. I just manually ran git gc on the soucregraph repo on cloud. A streaming diff search I was testing went from 8s to first result to 3s. Another benefit seems to be that git gc is when some of the new stuff in git gets computed (like reachability bitmaps). This has the potential of improving performance of sourcegraph.com across the board with not that much effort.

https://sourcegraph.slack.com/archives/CHPC7UX16/p1606128503338700