-
Notifications
You must be signed in to change notification settings - Fork 125
Perf: Traverse commit history instead of reading the packfile #698
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
Perf: Traverse commit history instead of reading the packfile #698
Conversation
301f3ca
to
fd8ac0b
Compare
i.iter, err = i.repo.CommitObjects() | ||
i.iter, err = | ||
i.repo.Log(&git.LogOptions{ | ||
All: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should force order by time (WDYT)?
By default pre-order will be used, which I think works slightly different than native git implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but here we don't want to mimic 100% git log output, we want to reduce unnecessary disk reads. Ordering commits will not give us any performance improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix tests
Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
To avoid show orphan commits and improve performance on commits table, instead of read all the objects from each repository and discard commits, we can execute from go-git a git log --all command and traverse commit history, avoiding read a lot of data from disk. Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
fd8ac0b
to
9748ee3
Compare
@kuba-- @erizocosmico tests finally passing |
Some numbers using gitbase-regression with complexity=2:
|
To avoid show orphan commits and improve performance on commits table, instead of reading all the objects from each repository and discard commits, we can execute from go-git a git log --all command and traverse commit history, avoiding read a lot of data from disk.
It closes #617