Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a static repository option to go-git #441

Closed
jfontan opened this issue Aug 27, 2018 · 1 comment · Fixed by #466
Closed

Add a static repository option to go-git #441

jfontan opened this issue Aug 27, 2018 · 1 comment · Fixed by #466
Assignees
Labels
performance Performance improvements proposal proposal for new additions or changes

Comments

@jfontan
Copy link
Contributor

jfontan commented Aug 27, 2018

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.

@jfontan jfontan added proposal proposal for new additions or changes performance Performance improvements labels Aug 27, 2018
@jfontan jfontan self-assigned this Aug 28, 2018
@jfontan
Copy link
Contributor Author

jfontan commented Aug 30, 2018

go-git changes in src-d/go-git#941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance improvements proposal proposal for new additions or changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant