-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make GitFileSystemObjectSink multi-threaded #12087
base: master
Are you sure you want to change the base?
Conversation
4e96f92
to
4bf9371
Compare
{ | ||
initLibGit2(); | ||
|
||
initRepoAtomically(path, bare); | ||
if (git_repository_open(Setter(repo), path.string().c_str())) | ||
throw Error("opening Git repository %s: %s", path, git_error_last()->message); | ||
|
||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would explain the 3.9× system
time used, as many individual blob files will be created.
Why did you disable this?
Could this be re-enabled, considering that you've changed it to multiple GitRepo
instances in the next commit?
Removing the packbuilder makes this a bit apples to oranges. Some users don't have great I/O on their systems and will be severely impacted by its removal, so I assume the removal was temporary. The packbuilder is already configured to use multiple threads.
A bounded queue may also help with memory pressure, at least if the individual files aren't too big. I would try to avoid using multiple packbuilders, because that means creating k times more packfiles. |
Motivation
This speeds up importing tarballs into the Git cache.
Time for importing a nixpkgs tarballs on Nix master:
With this PR:
TODO: this currently buffers all file contents in memory before writing them to disk, so it's no longer constant memory. But this could be fixed pretty easily (e.g. if there are more than N bytes worth of unwritten files, then wait).
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.