<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: y.senthilvasan</title>
    <description>The latest articles on DEV Community by y.senthilvasan (@ysenthilvasan).</description>
    <link>https://dev.to/ysenthilvasan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4112079%2F7230bffa-d173-46f4-8e82-599d4b8aa4e7.png</url>
      <title>DEV Community: y.senthilvasan</title>
      <link>https://dev.to/ysenthilvasan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ysenthilvasan"/>
    <language>en</language>
    <item>
      <title>I indexed a 96k-file Linux kernel tree in 2m51s on a laptop — benchmarking two code-graph MCP servers</title>
      <dc:creator>y.senthilvasan</dc:creator>
      <pubDate>Sat, 24 Oct 2026 19:36:33 +0000</pubDate>
      <link>https://dev.to/ysenthilvasan/i-indexed-a-96k-file-linux-kernel-tree-in-2m51s-on-a-laptop-benchmarking-two-code-graph-mcp-lmg</link>
      <guid>https://dev.to/ysenthilvasan/i-indexed-a-96k-file-linux-kernel-tree-in-2m51s-on-a-laptop-benchmarking-two-code-graph-mcp-lmg</guid>
      <description>&lt;h1&gt;
  
  
  I indexed a 96k-file Linux kernel tree in 2m51s on a laptop — benchmarking two code-graph MCP servers
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Disclosure up front: I'm the author of &lt;a href="https://github.com/offx-zinth/SMP" rel="noopener noreferrer"&gt;SMP (Structural Memory Protocol)&lt;/a&gt;&lt;/strong&gt; — an open-source (MIT) MCP server that keeps a live structural code graph. This post is the full methodology and numbers; everything below is reproducible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a code graph, not more grep
&lt;/h2&gt;

&lt;p&gt;Coding agents can read files. What they mostly can't do is answer &lt;em&gt;structural&lt;/em&gt; questions: who calls this, what breaks if I change it, which tests cover it. Grep gives you matches, not a map. Embedding-based RAG finds "similar" code, rarely "connected" code. So SMP maintains a graph: tree-sitter parses each file into nodes (functions, classes, modules) and edges (calls, contains, imports), stored in a &lt;strong&gt;single memory-mapped file with a journaled write-ahead log&lt;/strong&gt; — no Postgres, no Neo4j, no embeddings.&lt;/p&gt;

&lt;h2&gt;
  
  
  The machine, and why it matters
&lt;/h2&gt;

&lt;p&gt;Every number below was measured on the same laptop: an 8-thread 11th-gen Intel i7-1165G7, 14 GB RAM, NVMe, Linux, no GPU. Both tools did a fresh full index of the identical directory tree. No vendor numbers are mixed in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Headline: the Linux kernel
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Corpus&lt;/th&gt;
&lt;th&gt;SMP&lt;/th&gt;
&lt;th&gt;codebase-memory-mcp (fast mode)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Linux kernel snapshot — 95,937 files (72,171 parsed)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;2 min 51 s&lt;/strong&gt; — 839,516 nodes, 4,066,943 edges, 2.2 GB graph, 6.5 GB peak RAM&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;13 min 14 s&lt;/strong&gt; — 4.8 GB index&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4.6× faster on the same hardware, same tree.&lt;/strong&gt; One caveat: codebase-memory-mcp excluded 36 directories by design (gitignored/vendor paths), so node counts describe different graph models — wall-clock on the same input is the comparison.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small repo
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Corpus&lt;/th&gt;
&lt;th&gt;SMP&lt;/th&gt;
&lt;th&gt;codebase-memory-mcp&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;208-file Python repo&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;0.99 s&lt;/strong&gt; — 4,575 nodes / 18,862 edges&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;5.27 s&lt;/strong&gt; — 4,346 nodes / 22,002 edges&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What a store can actually do
&lt;/h2&gt;

&lt;p&gt;Micro-benchmark (&lt;code&gt;benchmarks/benchmark_scale.py --nodes 60000 --depth 3&lt;/code&gt;), synthetic graph, no MCP overhead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;60,000 node upserts: &lt;strong&gt;207 ms&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;240,000 edge upserts: &lt;strong&gt;916 ms&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Point lookup: &lt;strong&gt;p50 0.000 ms&lt;/strong&gt;, p95 0.001 ms&lt;/li&gt;
&lt;li&gt;Depth-3 BFS: &lt;strong&gt;p50 0.057 ms&lt;/strong&gt;, p95 0.084 ms&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The bug my own benchmark caught
&lt;/h2&gt;

&lt;p&gt;This is my favorite part. &lt;code&gt;locate&lt;/code&gt; used to &lt;strong&gt;re-load every node and re-tokenize the entire BM25 corpus on every query&lt;/strong&gt; — 1,493 ms p50 on a 4,575-node graph. On the 839k-node kernel graph it OOM-killed my desktop twice (systemd-oomd took out the whole session).&lt;/p&gt;

&lt;p&gt;The fix: a monotonic &lt;strong&gt;store revision counter&lt;/strong&gt; plus an engine-side corpus cache (≤250k nodes; larger graphs fall back to the original path). Results are &lt;strong&gt;byte-identical&lt;/strong&gt; to the pre-fix code, covered by 9 new equivalence/invalidation tests — and &lt;code&gt;locate&lt;/code&gt; dropped to &lt;strong&gt;40–85 ms p50 (~15–37× faster)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Other MCP tools on a warm 4,575-node graph: &lt;code&gt;smp_context&lt;/code&gt; p50 29.9 ms, &lt;code&gt;smp_file_outline&lt;/code&gt; p50 9.3 ms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;One line wires the MCP server + agent skill into Claude Code, OpenCode, Codex or Cursor:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://raw.githubusercontent.com/offx-zinth/SMP/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Repo (MIT, benchmark scripts included so you can re-run every table above on your own hardware): &lt;a href="https://github.com/offx-zinth/SMP" rel="noopener noreferrer"&gt;https://github.com/offx-zinth/SMP&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's still open
&lt;/h2&gt;

&lt;p&gt;Incremental re-index on partial edits at &amp;gt;500k nodes; monorepo-scale retrieval without vectors; Apple Silicon timing runs. If you run agents on a large repo, I genuinely want to know where it breaks for you.&lt;/p&gt;

</description>
      <category>python</category>
      <category>mcp</category>
      <category>ai</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
