Beyond GVFS: more details on optimizing Git for large repositories
May 30, 2017Edward Thomson

Summary
This post details specific optimizations made to Git and libgit2 to handle large repositories. For the Git index, it describes skipping binary searches when appending sorted paths during branch switches (reducing checkout time by 15-20%) and skipping SHA-1 checksum calculation on index reads for performance gains. For libgit2, it explains the transition from an O(n^2) exact rename detection algorithm to a linear time approach by using a hash map of file IDs, which resolved pull request timeouts for large refactorings.