objectfs: in-memory LRU read cache for SQLite metadata store #157
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 313 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #157"
general
weight: 0.35
justinsb
Phase 1 of #155: in-memory read cache in front of SQLite
Getoperations.Overview
LRUCacheinmetadata_cache.goto use an intrusive doubly-linked list with entry count bounding, byte size bounding (sizeFn), and access stats (Hits,Misses,HitRate).InodeandDirEntryrows keyed by(table, canonical_key).ENOENT) so repeat lookups for non-existent files do not hit SQLite.applyTxChangesLocked, the cache entries for created, updated, or deleted rows are updated or marked negative in the same critical section asv.sqliteDB.ApplyBatch.--metadata-cache-entries(default 65,536) and--metadata-cache-bytes(default 64 MiB) flags andWithMetadataCacheLimitsvolume/server options.---
Benchmark & Scale Measurements
1. Per-Operation Benchmark Comparison (
BenchmarkMetadataStoreOperations)| Operation | Legacy Store | SQLite (Cache ON) | SQLite (Cache OFF) | Speedup (Cache ON vs OFF) |
| :--- | :--- | :--- | :--- | :--- |
| Stat | 167 ns/op | 1,331 ns/op | 5,233 ns/op | 3.9x faster |
| Lookup | 229 ns/op | 2,383 ns/op | 10,215 ns/op | 4.3x faster |
| ReadDir | 27,902 ns/op | 257,127 ns/op | 697,821 ns/op | 2.7x faster |
| Create | 849,997 ns/op | 1,748,359 ns/op | 1,731,882 ns/op | ~1.0x (write path) |
| Rename | 812,011 ns/op | 1,673,111 ns/op | 1,718,968 ns/op | ~1.0x (write path) |
2. Scale & Cache Hit Rate Analysis (
TestBenchmarkMetricsReport)-
cache ON: Stat 5k: 1.75µs/op | Lookup 5k: 2.85µs/op | ENOENT 1k: 6.78µs/op | Hit Rate: 93.75% | Memory: 7,017 KB / 65,536 KB bound (31,001 entries)-
cache OFF: Stat 5k: 5.80µs/op | Lookup 5k: 11.19µs/op | ENOENT 1k: 4.34µs/op | Hit Rate: 0.00%-
cache ON: Stat 5k: 6.99µs/op | Lookup 5k: 8.93µs/op | Memory: 15,138 KB / 65,536 KB bound (65,536 entries bounded)-
cache OFF: Stat 5k: 5.70µs/op | Lookup 5k: 11.35µs/op | Memory: unbounded-
legacy: Stat 1,000 evicted inodes: 232.9µs/op | Lookup 10 dirs: 215.8µs/op-
sqlite (cache ON): Stat 1,000 inodes: 2.0µs/op | Lookup 10 dirs: 3.9µs/op (100% cache hit rate)-
sqlite (cache OFF): Stat 1,000 inodes: 5.7µs/op | Lookup 10 dirs: 23.8µs/op---
Fixes #155