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

Reduce calls to git cat-file -s #14682

Merged
merged 9 commits into from
Feb 17, 2021
Merged

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Feb 14, 2021

There are multiple places where there are repeated calls to git cat-file -s due to the blobs not being created with their size.

Through judicious use of git ls-tree -l and slight adjustments to the indexer code we can avoid a lot of these calls.

Signed-off-by: Andrew Thornton art27@cantab.net

There are multiple places where there are repeated calls to git cat-file
-s due to the blobs not being created with their size.

Through judicious use of git ls-tree -l and slight adjustments to the
indexer code we can avoid a lot of these calls.

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added performance/speed performance issues with slow downs performance/bigrepo Performance Issues affecting Big Repositories labels Feb 14, 2021
@zeripath zeripath added this to the 1.14.0 milestone Feb 14, 2021
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2021
@zeripath
Copy link
Contributor Author

Coupled with #14685 this will reduce the number of git calls in language settings from 2 per file + 2 (git ls-tree & get commit) -> 2 (git ls-tree and a single semi long running batch.)

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 15, 2021
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/git/parse_nogogit_test.go Show resolved Hide resolved
modules/git/parse_gogit_test.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 17, 2021
@6543
Copy link
Member

6543 commented Feb 17, 2021

🚀

@6543 6543 merged commit ae7e6cd into go-gitea:master Feb 17, 2021
@zeripath zeripath deleted the reduce-cat-file-s-calls branch February 17, 2021 22:21
@zeripath
Copy link
Contributor Author

Ok I'll take a look at the bleve and elastic indexers next - those could do with a single batch cat-file too

zeripath added a commit to zeripath/gitea that referenced this pull request Mar 27, 2021
git gc cron could change the size of the repository therefore we should update the
size of the repo stored in our database.

Also significantly improve the efficiency of counting lfs associated with the
repository

Fix go-gitea#14682

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. performance/bigrepo Performance Issues affecting Big Repositories performance/speed performance issues with slow downs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants