Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

remote fetch is extremely slow

Open
#1,146 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reproducing the slow update with the reported repository size and profiler output, focusing on kprocessor.py:1645 (_startCacheUpdate) and the pygit2 remote.py fetch entry point. Compare the time spent in git_remote_fetch with clone_repository and identify which post-retrieval operation accounts for the delay; done means the slowdown is isolated and an actionable fix or diagnosis is documented.

Written by the indexing model from the issue text.

Description

I have a tool that pulls down and installs a decent sized repository. Cloning the repo is fast and works well, however fetching subsequent updates is extremely slow. trying to figure out where the slowdown was coming from I ran my code through a profiler and obtained this result:

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.001 0.001 616.895 616.895 \bkprocessor.py:1645(_startCacheUpdate)
1 0.000 0.000 405.243 405.243 AppData\Roaming\Python\Python37\site-packages\pygit2\remote.py:120(fetch)
1 404.655 404.655 405.243 405.243 {built-in method pygit2.libgit2.git_remote_fetch}
1 0.000 0.000 210.191 210.191 AppData\Roaming\Python\Python37\site-packages\pygit2_init
.py:165(clone_repository)
1 204.704 204.704 210.191 210.191 {built-in method pygit2._libgit2.git_clone}

as you can see it cloned the repo in 210 seconds, pulling down nearly 1300 MB. during the clone additional commits came in and the subsequent fetch pulled down 42 MB quickly but then seemed to sit taking a total of 405 seconds, nearly twice as long as the clone operation.

Now I'm not sure exactly what in the fetch is taking so long, but whatever it is happens after retrieval of the data from the remote.

any advice on what I can do?

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

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.

More from libgit2/pygit2

All issues in libgit2/pygit2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.