repo.Commits.QueryBy(filename) slow on large repos
See original GitHub issueReproduction steps
1): Clone a large repo 2): run this function on that repo with some random file:
public IEnumerable<string> TestSlow(string filename)
{
using (var repo = new Repository(repoRoot))
{
string path = filename.Substring(repoRoot.Length + 1).Replace("\\", "/");
foreach (LogEntry entry in repo.Commits.QueryBy(path))
{
yield return entry.Commit.Author.ToString();
}
}
}
- run this command on the same file: “git log --follow --oneline – <file>”
Expected behavior
I expect similar time to be taken by TestSlow and the git log command above
Actual behavior
The git log command finishes in about 1.6 ms on my repo The TestSlow command takes about 70 seconds.
Here is what I see in my profiler:
Version of LibGit2Sharp (release number or SHA1)
0.27.0-preview-0017 0.26.1 0.24.1
Operating system(s) tested; .NET runtime tested
.NET Framework 4.7.2 on Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
repo.Commits.QueryBy(filename) slow on large repos
Reproduction steps. 1): Clone a large repo 2): run this function on that repo with some random file:
Read more >WHAT operations become slow when git repos ...
The answer is, most Git operations will get slower as the repo gets larger. But the operations which would make Git seem noticeably...
Read more >RStudio slow with git when large subdirectory exists in ...
Problem: I have an RProject directory that contains files needed to write and compile a bookdown project. This directory is also a local ......
Read more >Why is git add and git commit taking so long?
Large files: Adding and committing large files can take a long time, especially if they are binary files or if there are many...
Read more >Git's database internals III: file history queries
The primary way to discover which commits recently changed a file is to use git log ... This can be extremely slow for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Blueve Could you share your code for parsing the git.exe output?
Awesome work! I met same issue and I have to wrap a git.exe and use git log to speed up the log reading.