MCP server indexes 96k-file Linux kernel in 2m51s on a laptop — and the benchmark exposed a 1.5s query bug

Numerous_Beyond_2442 · reddit · 2026-10-25

Author Senthil released SMP (Structural Memory Protocol), an open-source live structural code graph that coding agents query over MCP, addressing the gap where agents can read files but can't reliably answer structural questions like who calls this, what breaks if changed, and which tests cover it.

Features: callers/callees and blast-radius analysis, file outlines, community detection, test-coverage context; BM25 keyword search with structural expansion (no embeddings); one-line install wires it into Claude Code, OpenCode, Codex, and Cursor; single-file memory-mapped graph, no database or server.

Benchmarks (same 8-thread i7-1165G7 laptop, no GPU): a 95,937-file Linux kernel snapshot indexes in 2m51s — 839,516 nodes / 4,066,943 edges, 2.2 GB graph, 6.5 GB peak RAM; 4.6x faster than codebase-memory-mcp (13m14s); 0.99s vs 5.27s on a 208-file repo (5.3x).

The bug the benchmark caught: locate reloaded every node and re-tokenized the entire BM25 corpus per query — 1,493ms p50 on a 4,575-node graph, and it OOM-killed his desktop twice on the 839k-node kernel graph (systemd-oomd took out the opencode session too). Fixed with a store revision counter + corpus cache (≤250k nodes with fallback), byte-identical results, 9 new tests; locate p50 is now 40–85ms.

Related event: Open-source SMP indexes 96K-file Linux kernel tree in 2m51s(2 posts)→

Original post →

More from coding & agent

coding & agent channel →