libgit2 / libgit2/libgit2sharp
ObjectId are materialized too early in git_odb_foreach
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
When enumerating objects in an ObjectDatabase, all ObjectId_s are materialized before enumeration. In a reasonable active repostory this results in a large working set and delay of processing.
-
Proxy should provide an equivalent of git_odb_foreach that is lazy/on-demant and does not materialize all ObjectId_s. (https://github.com/libgit2/libgit2sharp/blob/7f59d22c4fdb7b3d14511aca567e64eefaa43ab2/LibGit2Sharp/Core/Proxy.cs#L1557)
-
ObjectDatabase should use the lazy enumerator from Proxy instead of the ICollection (https://github.com/libgit2/libgit2sharp/blob/7f59d22c4fdb7b3d14511aca567e64eefaa43ab2/LibGit2Sharp/ObjectDatabase.cs#L44)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
阅读 LibGit2Sharp/Core/Proxy.cs 第 1557 行附近的内容,以及 ObjectDatabase.cs 第 44 行附近的内容。追踪当前如何公开 ObjectId_s,并确定如何让 Proxy 枚举保持 lazy;完成标准是 ObjectDatabase 在不先 materialize 每个 ObjectId_s 的情况下进行枚举。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- devtools, performance
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100