libgit2 / libgit2/libgit2

Cloning large repo in libgit2 slower than `git clone`

Open
#4,674 19 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
C
Stars
10.6k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

I didn't see this when I briefly checked the list of issues, so sorry if it's already been reported. Both libgit2 and git clone spend roughly the same amount of time downloading (around 30 seconds or so), but the "Resolving deltas" stage is much slower using libgit2.

Reproduction steps

I just cloned git://sourceware.org/git/glibc.git using the example code in the repository.

Expected behavior

Both libgit2 and git clone take roughly the same amount of time.

Actual behavior

libgit2 takes around 4 minutes, whereas git clone takes about 1.5 minutes.

Version of libgit2 (release number or SHA1)

0.27.0 (I've also tested whatever the Rust crate git2 downloads by default, and the speed was about the same).

Operating system(s) tested

Linux alex-linux 4.16.13-2-ARCH #1 SMP PREEMPT Fri Jun 1 18:46:11 UTC 2018 x86_64 GNU/Linux

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

Start with the example code in the repository and reproduce the clone of git://sourceware.org/git/glibc.git using libgit2 0.27.0, comparing it with git clone on Linux. Investigate the resolving-deltas stage; done means the libgit2 clone time is brought substantially closer to git clone's reported timing.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, git
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.