perf: port measured git-metadata and clone-census improvements from #1577/#1580 - #1882
Merged
Merged
Conversation
`GitMetadataFingerprintV1::capture` is the tier-1 staleness signal sampled on every query admission, and this module's own contract calls that cost fixed and cheap. Resolving the git-dir and common-dir through a fresh `gix::open` dominated it, while runtime-core already owns a revalidating topology memo that answers the same question. The memo is asked only for a checkout carrying `<root>/.git`, which is both where an open at exactly this root resolves through and where a discovery started at this root stops, so it returns the same two paths. A bare repository's control directory, or a path that is not a checkout root, still opens directly, because discovery would walk past it to an ancestor whose git metadata does not describe this project. The fingerprint samples file metadata and contents, so its value and its persisted signature are unchanged. Measured by the ignored `measure_git_metadata_fingerprint_capture` test added here, one-ref fixture repository, 2000 warm iterations after a 100-iteration warmup: 127.9us per capture before, 27.7us after. Ports e4290b0 from #1580, where the same change measured 75.2us to 10.0us on different hardware. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`clone_body_payloads` is keyed by payload digest, so one row backs every occurrence that shares that body. The census joined the two tables and re-derived a payload's four canonical digests once per occurrence, so a corpus of 128 distinct payloads verified those 128 payloads 98,304 times, inside a status read that holds the scheduler lock. Validate the payload table once, retain only the rename coverages the per-occurrence counters distinguish, and classify occurrences against that verified index. Both prior refusals are kept and two are added: a payload whose blob disagrees with its stored digest, and an occurrence whose payload row is absent. The inner join used to drop that second case from the totals without saying so, reporting a healthy census over fewer bodies than the artifact holds, which is worse than a refusal because nothing downstream can tell the count is short. The new `census_refuses_an_occurrence_whose_payload_row_is_absent` test pins it, and fails against the previous census with `source_bodies: 1` for two stored occurrences. Measured by the ignored `measure_read_clone_index_census` test added here, 98,304 occurrences over 128 payloads: 2.282s before, 0.310s after. Ports ea06d59 from #1577. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the two production perf commits from #1577 and #1580 that still apply to master, each with an
#[ignore]d measurement test so a reviewer can rerun the numbers.From #1580:
git_metadata_dirsin the code-index scheduler identity resolves the git and common dirs throughrepository_topologyinstead of re-walking the repository.measure_git_metadata_fingerprint_capture(2000 timed iterations on a one-ref fixture) reads 127.9 µs per capture before and 27.7 µs after.From #1577: the clone-index census in the query crate no longer decodes every occurrence payload.
measure_read_clone_index_censusover 98,304 occurrences across 128 payloads reads 2.282 s before and 0.310 s after.census_refuses_an_occurrence_whose_payload_row_is_absentpins the undercount the old path produced (one source body reported for two stored occurrences).Not ported: the event-driven wait in
wait_for_production_composition_code_indexfrom #1580 (only measurable through a 165 s journey suite, left for its own PR) and the hand-writtenDeserializefrom #1577 (157 lines of byte-compatibility maintenance for a claimed 17% on one decode step that the census port already removes from its hottest path). The third shared commit on those branches, seating text through retryable graph activation, is #1877.🤖 Generated with Claude Code