Comments (6)
I did another git bisect
(while making sure that bin
was deleted) and I can reproduce it with 21d4f13 where libgit2 was updated to 1.2.0
from libgit2sharp.
That was two and a half years ago. A lot has changed since then. It's going to be tricky to isolate the problem.
One question to start - what's the perf if you have one repository per thread instead of sharing the repository across threads?
from libgit2sharp.
Thanks for your reply!
One question to start - what's the perf if you have one repository per thread instead of sharing the repository across threads?
You mean one Repository
object (using the same path) per thread? I can try that 👍🏻
Also, I did try to implement a similar benchmark test in libgit2
but my skills in C are insufficient 😅
from libgit2sharp.
One question to start - what's the perf if you have one repository per thread instead of sharing the repository across threads?
Spot on! Using one Repository
instance per thread does the trick 🙌🏻
Should we document how to properly use libgit2(sharp) in a multi-thread environment? Or maybe it's possible to (re)enable concurrent reads on a single Repository
instance?
from libgit2sharp.
Right — really good question. I was mostly hoping to stem the bleeding and get you to a performant situation. Digging in to the why it's slow would be really interesting.
https://github.com/libgit2/libgit2/blob/main/docs/threading.md#sharing-objects has a bit of a discussion about libgit2's threading policy (which LibGit2Sharp should also document as it should be identical — I don't think that there's anything in LibGit2Sharp that makes threading any different).
Without actually doing a serious investigation: probably you're hitting a lock on an object cache. Why that got worse, I don't know, and we should 👀 that. But the most performant way to do what you're doing is multiple Repository
instances (although there will be a bit of a memory usage increase, since you won't have a cache shared across a single repository).
from libgit2sharp.
Thanks again for your insight.
libgit2/libgit2@main/docs/threading.md#sharing-objects has a bit of a discussion about libgit2's threading policy (which LibGit2Sharp should also document as it should be identical
👍🏻
I don't think that there's anything in LibGit2Sharp that makes threading any different
Without actually doing a serious investigation: probably you're hitting a lock on an object cache
Should we move this issue to https://github.com/libgit2/libgit2?
But the most performant way to do what you're doing is multiple Repository instances (although there will be a bit of a memory usage increase, since you won't have a cache shared across a single repository).
Alright!
I wasn't sure that it was indeed the most performant solution. I will update my code base accordingly. Thank you!
from libgit2sharp.
Related Issues (20)
- Security: Update to libgit2 1.7.2 HOT 3
- unexpected EOF when trying to fetch from remote
- Please consider adding AOT support for .Diff.Compare<T>() HOT 19
- How to checkout a specific folder from repository?
- LibGit2SharpException: could not find appropriate mechanism for credentials HOT 5
- FetchOptions in CloneOptions is readonly and has not been set in constructor !
- Git Fetch fails with could not decrypt tls message when TLS 1.3 is allowed
- git 2.40.0 index.skipHash incompatible with libgit2sharp (please update libgit2 from 1.7.1 to 1.8.0)
- the command pull take the class Repository instead of the interface like other commands
- Security Vulnerabilities in git2-106a5f2.dll: Non-Compliance with Secure Hashing and Compiler Security Best Practices HOT 2
- Request - upgrade to libgit2 1.7.2 HOT 1
- the error "too many redirects or authentication replays libgit2shap" come up after upgrading from 0.28 to 0.30 on Fetch
- Certificate Verification Failed "unknown certificate lookup failure" HOT 1
- Replace <PackageLicenseFile> with <PackageLicenseExpression>
- CommitLog order does not reflect order of commits.
- Error pushing to github using 0.26.2 HOT 4
- Unable to push the commit to the Bitbucket Repository in C# using LibGit2Sharp
- Exception when using it inside a Visual Studio 2022 Extensibility project HOT 2
- SSL error; syscall failure: Connection reset by peer when push 1.3 GB filesize
- Capture error details of "remote unpack failed"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libgit2sharp.