perf(install): map cached packuments, skip re-hashing unchanged ones and prefetch the OSV bloom #2016
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 593 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.382
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2016"
general
weight: 0.35
jdx
Repeat installs that reuse aube's packument cache (vlt's "cache" benchmark: no lockfile, no
node_modules, warm cache) spent much of their resolve time copying and hashing cached packuments. Every warm read loaded each full packument into memory and recomputed its BLAKE3 digest before trusting the derived resolution index, so cost grew with packument size even when only a few releases were used.This PR makes those installs 4–26% faster on vlt's fixtures and cuts their peak memory by more than half:
atomic_write), so a mapped entry never shrinks under a running install..resolution-index-v3) records the file's ctime and when its digest was last checked. The digest is trusted without re-hashing only when that check happened more than 2 seconds after the file's ctime, the same racy-clean rule git uses for its index. ctime can't be set by users, so any in-place rewrite moves it and forces a fresh hash. A file changed close to its last check is still hashed, and the first matching hash outside the window records the new check time. Non-Unix platforms always hash.derived_index_rejects_same_length_rewrite_with_unchanged_timestampstill passes, and a new test covers both sides of the window.{/}peek is dropped fromResolutionIndex::into_resolution. The index is used only after the content is known to match, and that peek touched a page of the mapped file for every release.--offlineinstalls never start it.Benchmarks
vlt's fixtures,
aube install --ignore-scripts --silentwithCI=true(global virtual store off, as on vlt's runners), release build, 4-vCPU Linux VM. The base ismainat 4741bcb. Runs are interleaved round-robin because this VM's load drifts too much for back-to-back hyperfine blocks. Times are median wall seconds.cache (warm
~/.cache/aubeand store, no lockfile ornode_modules; 10 rounds):| fixture | main | this PR | change | bun |
|---|---|---|---|---|
| astro | 0.69 | 0.62 | −9% | 0.24 |
| babylon | 4.94 | 4.72 | −4% | 4.25 |
| large | 2.93 | 2.75 | −6% | 1.08 |
| next | 1.10 | 1.04 | −5% | 0.45 |
| svelte | 0.26 | 0.19 | −26% | 0.08 |
| vue | 1.21 | 1.06 | −13% | 0.41 |
Resolve phase (
AUBE_DIAG_SUMMARY, 12 interleaved rounds): next 362 → 191 ms, large 415 → 274 ms. Peak RSS on next: 681 → 280 MB.clean (store and caches wiped every run; 5 rounds, 3 for babylon): astro 2.65 → 2.67, babylon 16.6 → 18.1, large 5.80 → 5.69, next 4.90 → 4.98, svelte 1.13 → 1.16, vue 2.64 → 2.57. These differences are within this VM's noise. The bloom prefetch can't be measured here because the proxy blocks the OSV hosts, so these runs used
AUBE_ADVISORY_CHECK=off.What's left
Most of the remaining "cache" gap to bun is materializing the per-project
.aube/tree: about 750 ms of hard links on next and 1.6 s on large. Lowering link parallelism (2/4/8/64 permits) made no difference to wall time, so that needs a different approach.AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Improvements
Dependency resolution reuses cached package metadata more efficiently while checking that cached data remains valid.
On supported systems, package metadata can be read more efficiently; other platforms retain their existing read behavior.
Security advisory data can begin refreshing during eligible online dependency resolutions. Checks refresh again before use if the early refresh fails or the data is no longer fresh.
* Cached security advisory data is checked for freshness and consistency before it is reused.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---
_Generated by Claude Code_