question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Git` Performance issue in dulwich

See original GitHub issue

Bug Report

Sometimes dvc exp show will take more than 10s to get a response, use Cprofile we notice that the time was costed in _load_file_contents in dulwich ,

image

related cprofile my.prof.zip

Description

Reproduce

Expected

Environment information

Output of dvc doctor:

$ dvc doctor

Additional Information (if any):

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
pmrowlacommented, Nov 2, 2022

@dberenbaum we discussed it and this probably only requires filling out the libgit/pygit fetch/push implementations in scmrepo (currently we just only have dulwich implementation done, since there was never an explicit need for anything else until now).

libgit/pygit should at least be faster than dulwich, and this will be simpler than trying to dig into actual optimizations in dulwich upstream.

once that’s done we can revisit this later (and consider doing upstream optimizations) if there’s still a significant performance gap between using libgit/pygit and CLI git (but I don’t expect there will be a significant difference)

1reaction
karajan1001commented, Oct 27, 2022

Takes about 1.16s.

 time git push ../vscode/ HEAD:refs/head/HEAD                                                                                                    -1-[ins][8:43:55]
Enumerating objects: 34763, done.
Counting objects: 100% (34763/34763), done.
Delta compression using up to 10 threads
Compressing objects: 100% (8562/8562), done.
Writing objects: 100% (34763/34763), 44.23 MiB | 74.38 MiB/s, done.
Total 34763 (delta 25344), reused 34733 (delta 25318), pack-reused 0
remote: Resolving deltas: 100% (25344/25344), done.
To ../vscode/
 * [new reference]       HEAD -> refs/head/HEAD
git push -f ../vscode/ HEAD:refs/head/HEAD  1.16s user 0.37s system 133% cpu 1.151 total
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dulwich - Git SCM
It aims to provide an interface to git repositories (both local and remote) that doesn't call out to git directly but instead uses...
Read more >
Python implementation of Git — dulwich 0.20.46 documentation
The reason for this is that they significantly improve the performance since some low-level operations that are executed often are much slower in...
Read more >
Python implementation of Git — dulwich 0.19.12 documentation
Overview¶. Build Status Windows Build Status. This is the Dulwich project. It aims to provide an interface to git repos (both local and...
Read more >
Git in pure Python: Full Dulwich example - This Data Guy
Dulwich can do a lot with git (much more than what I needed). It can handle higher and lower level git APIs. The...
Read more >
Bug #829298 “git performance suffers for large repositories” : Bugs ...
This is partly due to a lack of support for generating proper git pack files in dulwich (bug 562673) and partly due to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found