Skip to content

Add a static repository option to go-git #441

@jfontan

Description

@jfontan

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.

Metadata

Metadata

Assignees

Labels

performancePerformance improvementsproposalproposal for new additions or changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions