libgit2 / libgit2/libgit2sharp
ObjectId are materialized too early in git_odb_foreach
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read LibGit2Sharp/Core/Proxy.cs around line 1557 and ObjectDatabase.cs around line 44. Trace how ObjectId_s are currently exposed and determine how the Proxy enumeration can remain lazy; done means ObjectDatabase enumerates without materializing every ObjectId_s first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- devtools, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100