8000 Add `git_mempack_write_thin_pack` by roberth · Pull Request #6875 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

Add git_mempack_write_thin_pack #6875

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

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

roberth
Copy link
Contributor
@roberth roberth commented Sep 2, 2024

Unlike existing functions, this produces a thin packfile by making use of the fact that only new objects appear in the mempack Object Database.

A thin packfile only contains certain objects, but not its whole closure of references. This makes it suitable for efficiently writing sets of new objects to a local repository, by avoiding many small I/O operations.

This relies on write_pack (e.g. git_packbuilder_write_buf) to implement the "recency order" optimization step.

Basic measurements comparing against the writing of individual objects show a speedup during when writing large amounts of content on machines with comparatively slow I/O operations, and little to no change on machines with fast I/O operations.

I have used this in NixOS/nix#11330, in conjunction with #6874

@ethomson
Copy link
Member
ethomson commented Sep 2, 2024

Thanks! Really useful addition; I'll review this shortly. 🙏

@Mic92
Copy link
Mic92 commented Sep 20, 2024

@ethomson friendly ping.

Copy link
Member
@ethomson ethomson left a comment

Choose a reason for hiding this comment

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

Thanks for this. I made two very trivial minor suggestions in keeping with the library's styling. Otherwise, a great addition. 🙏

Unlike existing functions, this produces a _thin_ packfile by
making use of the fact that only new objects appear in the
mempack Object Database.

A thin packfile only contains certain objects, but not its whole
closure of references. This makes it suitable for efficiently
writing sets of new objects to a local repository, by avoiding
many small I/O operations.

This relies on write_pack (e.g. git_packbuilder_write_buf) to
implement the "recency order" optimization step.

Basic measurements comparing against the writing of individual
objects show a speedup during when writing large amounts of
content on machines with comparatively slow I/O operations,
and little to no change on machines with fast I/O operations.
@roberth roberth force-pushed the mempack-thin-packfile branch from 14e355d to f9c35fb Compare September 27, 2024 10:39
@Mic92
Copy link
Mic92 commented Sep 27, 2024

CI is green!

@ethomson ethomson merged commit 9ddd72f into libgit2:main Sep 27, 2024
19 checks passed
@Mic92
Copy link
Mic92 commented Sep 28, 2024
8000

Question, will this patch be part of the v1.8.2 or later?

@ethomson
Copy link
Member

I'm going to cut a release 🔜

@roberth
Copy link
Contributor Author
roberth commented Sep 29, 2024

Thank you @ethomson for reviewing and accepting!

@Ericson2314
Copy link

I'm going to cut a release 🔜

Any ETA on this?

@Mic92
Copy link
Mic92 commented Nov 24, 2024

1.8.4 was released a while ago but this patch is no included. Are the patch releases made of a different branch?

@Ericson2314
Copy link

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

Successfully merging this pull request may close these issues.

4 participants
0