Repository navigation
Description
Triage update — 2026-10-17
Completed
- Batched historical blob measurement: perf(facts): batch historical blob size lookups #1056 and perf(facts): batch blob checks across history commits #1058 (merged).
- Avoid measuring expired history blobs: perf(facts): filter expired history before measuring blobs #1059 (merged).
- History progress and phase timing output: feat(facts): report history progress and phase timings #1061 (merged).
- Event-driven Git subprocess completion: perf(git): wake subprocess callers on completion events #1062 (merged).
The original per-path-spawn diagnosis and missing timing-output description below are historical. They no longer describe current main.
Remaining scope
Decide whether history ingestion should bound all-ref/reflog-only reachability. Current enumeration still includes reflog-only commits. This is a product and correctness decision, not another batching implementation.
- Measure which reachability classes contribute to
excavate, history and recovery queries on pinned repositories. - Compare scope options with identical history objects, retention limits and query expectations.
- Preserve recovery of otherwise unreachable changes, or explicitly document an opt-in policy and its tradeoff.
- Add contract tests for the chosen policy before changing defaults.
The old wall times are motivation, not a current performance baseline. Use the merged PRs' benchmark provenance when comparing improvements.
Original report and historical evidence
Why
A cold pixel build-index --history . on a worktree of this repo took 253 s. Reproduced on a fresh clone of the same repo: 140.7 s, with 275 of 287 work ticks spent in phase B (blob measuring). Phase A (metadata) and phase C (diff text) are cheap; phase B is the bottleneck.
Evidence (measured 2026-10-06)
| Phase | Evidence | Cost |
|---|---|---|
| Text index (1,028 files) | printed early, base_files=1028 |
negligible |
| Phase A — commit metadata | git log batches of 200 |
~24 ms/batch |
| Phase B — blob measuring | 275/287 ticks | ~70–80 s of 140 s |
| Phase C — diff text (365-day window) | 10 ticks | ~15–20 s |
Root cause: measure_commit_blobs (crates/pixel-facts/src/ingest.rs:803) measures one git ls-tree -l process per changed path (blob_size, ingest.rs:847), plus a second spawn per rename against the parent tree. The repo has ~9,170 changed-path rows across 1,024 commits → 10k+ git spawns at ~7 ms each. The comment above the function says cat-file --batch-check, but the implementation is per-path ls-tree.
Amplifier: ingest scope is all refs + stash + every reflog-only commit (rev-list --branches --remotes --tags --reflog, ingest.rs:487,512). A worktree's reflog enumeration picked up 2,382 commits vs 853 on HEAD (commits=2224 in the log), ~1.9× the work.
Ask
- Batch phase B: replace per-path
ls-treespawns with one batchedcat-file --batch-check(or onels-treeper commit listing all paths). Expected: phase B drops from ~70 s to seconds; cold--historybuild under a minute on this repo. - Per-phase timing logs: report/log phases A, B and C separately (tick reports already carry
phase; surface a per-phase duration breakdown in thebuild-indexsummary so regressions are visible withoutPIXEL_FACTS_DEBUG_TICKS=1). - Scope control: don't index much more than needed — reflog-only commits inflate the work ~1.9× on worktrees and churn-heavy repos. Study what actually pays off in
excavate/rescue/historyqueries and consider bounding reach (e.g. skip reflog-only by default, or an opt-in/out flag), keeping the age window + size budget limits.
Notes
PIXEL_FACTS_DEBUG_TICKS=1exists but only prints raw tick reports.- Reproduction: wipe
history.db, runpixel build-index --history ., watch ticks 2–277 sit inphase_b.
Activity
[-]Facts ingest: batch phase-B blob measuring, per-phase timing logs, and tighter ingest scope[/-][+]facts: decide history reachability and reflog scope after merged ingest optimizations[/+]