remote fetch is extremely slow
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 408
- 平均合并
- 2 天 57 分钟
- 30 天内合并 PR
- 7
描述
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?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用报告中的仓库大小和分析器输出重现更新缓慢的问题,重点检查 kprocessor.py:1645 (_startCacheUpdate) 以及 pygit2 remote.py 的 fetch 入口点。比较 git_remote_fetch 和 clone_repository 所耗费的时间,并确定哪个检索后的操作导致了延迟;完成标准是隔离出变慢的环节,并记录一项可执行的修复方案或诊断结果。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, python
- 领域
- performance
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100