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

git: worktree_commit, just store objects not already stored #224

Merged
merged 4 commits into from Feb 9, 2021
Merged

git: worktree_commit, just store objects not already stored #224

merged 4 commits into from Feb 9, 2021

Conversation

jsteuer
Copy link
Contributor

@jsteuer jsteuer commented Dec 10, 2020

Hi!

If I do a simple single file commit using go-git, lots of files within .git/objects/ are touched - they all has the same last modified timestamp. If I do that same simple commit using the regular git CLI, only few files are touched.

The change of this PR seems to fix this behavior by simply checking if the object is already stored. But maybe I'm missing something?

However, the current gain in performance is impressive: on my test repository (25k files, 1k commits, total size <100MB) the time to commit drops from 3.4s down to 2.2s.

@mcuadros
Copy link
Member

Hi,

Can you provide a test checking the files are saved?

@jsteuer
Copy link
Contributor Author

jsteuer commented Feb 3, 2021

Hi, sure, I added a unit test. It checks, that the objects are saved and by comparing the timestamps, it ensures that there is no write to the same object over and over again.

@mcuadros mcuadros merged commit c66023a into go-git:master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants