Skip to content

Make GitFileSystemObjectSink multi-threaded#149

Merged
edolstra merged 13 commits intodetsys-mainfrom
multithreaded-git-sink-2
Jul 28, 2025
Merged

Make GitFileSystemObjectSink multi-threaded#149
edolstra merged 13 commits intodetsys-mainfrom
multithreaded-git-sink-2

Conversation

@edolstra
Copy link
Collaborator

@edolstra edolstra commented Jul 15, 2025

Motivation

Updated version of upstream NixOS#12087. It makes importing tarballs into the tarball cache quite a bit faster (e.g. 11.7s to 3.6s for nixpkgs master on Linux, 14.7s to 7.2s on macOS).

Benchmarked using:

# wget https://github.com/NixOS/nixpkgs/archive/refs/heads/master.tar.gz
# rm -rf ~/.cache/nix/tarball-cache/
# command time nix flake metadata tarball+file://$(pwd)/master.tar.gz

Context

@github-actions
Copy link

github-actions bot commented Jul 15, 2025

@github-actions github-actions bot temporarily deployed to pull request July 15, 2025 14:11 Inactive
@edolstra edolstra added the flake-regression-test Run the flake regressions test suite on this PR label Jul 15, 2025
@edolstra edolstra closed this Jul 15, 2025
@edolstra edolstra reopened this Jul 15, 2025
@github-actions github-actions bot temporarily deployed to pull request July 15, 2025 14:34 Inactive
@edolstra edolstra marked this pull request as ready for review July 16, 2025 13:24
@github-actions github-actions bot temporarily deployed to pull request July 16, 2025 13:58 Inactive
On Linux, it makes import slower, but on macOS, we really need it.
@edolstra edolstra force-pushed the multithreaded-git-sink-2 branch from 51861d6 to c478d98 Compare July 16, 2025 16:02
@github-actions github-actions bot temporarily deployed to pull request July 16, 2025 16:07 Inactive
Comment on lines 1023 to 1030
bool useMempack =
// On macOS, mempack is beneficial.
#ifdef __linux__
false
#else
true
#endif
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should this be ifdef macos true instead? Since we know that it's beneficial on macOS, but it may not be beneficial on e.g. FreeBSD or Windows, etc (I don't know if those platforms even get here, but to me it'd be more readable this way)

@github-actions github-actions bot temporarily deployed to pull request July 23, 2025 14:25 Inactive
@edolstra edolstra added this pull request to the merge queue Jul 28, 2025
Merged via the queue into detsys-main with commit 74eb199 Jul 28, 2025
42 checks passed
@edolstra edolstra deleted the multithreaded-git-sink-2 branch July 28, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flake-regression-test Run the flake regressions test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants