Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

remote fetch is extremely slow

未關閉
#1,146 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
git, python
領域
performance

研究方向

先使用回報的儲存庫大小和分析器輸出重現更新緩慢的問題,重點檢查 kprocessor.py:1645 (_startCacheUpdate) 以及 pygit2 remote.py 的 fetch 進入點。比較 git_remote_fetch 和 clone_repository 所花費的時間,並找出哪個擷取後的操作造成延遲;完成的定義是已隔離變慢的環節,並記錄一項可執行的修正方案或診斷結果。

由索引模型根據 Issue 內容生成。

描述

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?

主要語言
Python
星號
1.7k
分支
409
平均合併
1 天 21 小時
30 天內合併 PR
4

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

libgit2/pygit2 的其他 Issue

查看 libgit2/pygit2 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。