libgit2 / libgit2/libgit2sharp

Commit and stage execution time not constant

Open
#683 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

I am currently using LibGit2Sharp (v0.15.0) to keep track of differences in many HTML files (~10,000). Each change to a file or new file results in a single commit. I have noticed that writes and commits are getting slower and slower. Here is a visualization of my tests:
graph

I tried to adjust the repository.Stage(...) and repository.Commit(...) time so that the size of the HTML file size was not taken into account. This was done by simply dividing the write and commit time by the file size.

I was not sure whether this slow down was expected, but after a bit of reading around, it seems to me that git commit should be constant time with respect to the number of commits or files already in the repository. I am not sure if the same assumption can be made about staging.

Is this a known issue with LibGit2Sharp? Or libgit2?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported slowdown with LibGit2Sharp v0.15.0 using the issue's workload of about 10,000 HTML files, measuring Stage and Commit as the repository grows. Compare the results with the expected Git behavior and determine whether the cause belongs to LibGit2Sharp or libgit2; document the finding and any relevant upstream issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.