8000 `git_diff_find_similar` takes long and miss renames on a large commit in a large repo · Issue #7074 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

git_diff_find_similar takes long and miss renames on a large commit in a large repo #7074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kojiishi opened this issue May 11, 2025 · 0 comments

Comments

@kojiishi
Copy link

To reproduce, please check out the chromium repo and show the commit id 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1.

With the git command:

$ time git show 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1 >/dev/null

real    0m5.319s
user    0m0.000s
sys     0m0.015s

and this detects renames correctly.

If I do this in my code:

  1. git_diff_tree_to_tree takes 813ms
  2. git_diff_find_similar takes 173s (not ms)
  3. git_diff_foreach takes 20s (not ms)

and renames are not detected.

I also tried to create on-memory Index and used git_diff_index_to_index instead of git_diff_tree_to_tree, but the result still look similar.

I'm new to libgit2, so I may be doing something wrong, but any advice appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0