Skip to content

addToStore(): Don't parse the NAR#14323

Merged
xokdvium merged 5 commits intomasterfrom
skip-nar-parse
Oct 23, 2025
Merged

addToStore(): Don't parse the NAR#14323
xokdvium merged 5 commits intomasterfrom
skip-nar-parse

Conversation

@edolstra
Copy link
Member

@edolstra edolstra commented Oct 22, 2025

Motivation

This speeds up the case when we're adding a path that already exists in the store, and we're reading from a seekable source (e.g. in nix-store --import).

Note that this does require the narSize field to be correct, but that seems like a reasonable assumption.

Taken from DeterminateSystems#238.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This is slightly faster than doing a read() into a buffer just to
discard the data.
@edolstra edolstra requested a review from Ericson2314 as a code owner October 22, 2025 11:52
@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Oct 22, 2025
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
`skip()` can throw an exception, which we need to ignore since we may
be unwinding an exception.
@edolstra edolstra enabled auto-merge October 23, 2025 14:39
@xokdvium xokdvium disabled auto-merge October 23, 2025 19:15
@xokdvium xokdvium merged commit d6f1e2d into master Oct 23, 2025
20 checks passed
@xokdvium xokdvium deleted the skip-nar-parse branch October 23, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants