-
Notifications
You must be signed in to change notification settings - Fork 127
Description
go-git is always querying the system to search for objects. If we are sure that the repository is not going to change we can do some optimizations and skip expensive system calls.
I've tried one of these optimizations in DotGit.Object. The first time it reads all the objects into a map and instead of trying to open the file to check for them search the map. This, alongside maintaining packfiles opened, improved performance.
Repository: linux (2013), numpy, tensorflow
Number of rows: 395709
Query: SELECT count(*) FROM commits c NATURAL JOIN ref_commits r WHERE r.ref_name = 'HEAD';
Change from #440 : 1 row in set (20 min 43.69 sec)
This proposal: 1 row in set (13 min 19.41 sec)
Add a new option to git repository open to expect the repository to be static.