Performance benchmarks
1,300x faster
than CLI tools.
Apple M4 Pro · 48GB RAM · pre-indexed MCP queries · 20 iterations avg
MCP query latency
0.05ms
vs 55ms codedb CLI
vs ast-grep
64x
faster than 3.2ms
vs ripgrep
126x
faster than 6.3ms
Token reduction
1,628x
fewer than grep output
Query latency
codedb repo (20 files, 12.6k lines)

Query | codedb MCP | codedb CLI | ast-grep | ripgrep | grep | MCP speedup
--- | --- | --- | --- | --- | --- | ---
File tree | 0.04 ms | 52.9 ms | · | · | · | 1,253x vs CLI
Symbol search (`init`) | 0.10 ms | 54.1 ms | 3.2 ms | 6.3 ms | 6.5 ms | 549x vs CLI
Full-text search (`allocator`) | 0.05 ms | 60.7 ms | 3.2 ms | 5.3 ms | 6.6 ms | 1,340x vs CLI
Word index (`self`) | 0.04 ms | 59.7 ms | n/a | 7.2 ms | 6.5 ms | 1,404x vs CLI
Structural outline | 0.05 ms | 53.5 ms | 3.1 ms | · | 2.4 ms | 1,143x vs CLI
Dependency graph | 0.05 ms | 2.2 ms | n/a | n/a | n/a | 45x vs CLI

merjs repo (100 files, 17.3k lines)

Query | codedb MCP | codedb CLI | ast-grep | ripgrep | grep | MCP speedup
--- | --- | --- | --- | --- | --- | ---
File tree | 0.05 ms | 54.0 ms | · | · | · | 1,173x vs CLI
Symbol search (`init`) | 0.07 ms | 54.4 ms | 3.4 ms | 6.3 ms | 3.6 ms | 758x vs CLI
Full-text search (`allocator`) | 0.03 ms | 54.1 ms | 2.9 ms | 5.1 ms | 3.7 ms | 1,554x vs CLI
Word index (`self`) | 0.04 ms | 54.7 ms | n/a | 6.3 ms | 4.2 ms | 1,518x vs CLI
Structural outline | 0.04 ms | 54.9 ms | 3.4 ms | · | 2.5 ms | 1,243x vs CLI
Dependency graph | 0.05 ms | 1.9 ms | n/a | n/a | n/a | 41x vs CLI

Token efficiency
Structured results, not raw dumps
codedb returns structured, relevant results. For AI agents, this means dramatically fewer tokens per query compared to grep/ripgrep raw output.

Repo | codedb MCP | ripgrep / grep | Reduction
--- | --- | --- | ---
codedb (search `allocator`) | ~20 tokens | ~32,564 tokens | 1,628x fewer
merjs (search `allocator`) | ~20 tokens | ~4,007 tokens | 200x fewer

Indexing speed
Cold start to ready
codedb builds all indexes on startup: outlines, trigram, word, dependency graph. After startup, the file watcher keeps indexes updated. Single-file re-index: <2ms.

Repo | Files | Lines | Cold start | Per file
--- | --- | --- | --- | ---
codedb | 20 | 12.6k | 17 ms | 0.85 ms
merjs | 100 | 17.3k | 16 ms | 0.16 ms
openclaw/openclaw | 11,281 | 2.29M | 75 s | 6.66 ms
vitessio/vitess | 5,028 | 2.18M | 50 s | 9.95 ms

### Query Latency (ms, log scale)

### Token Efficiency (search 'allocator')

### Indexing Speed by Repo Size

### MCP Speedup vs CLI

Comparison
Feature matrix

Feature | codedb MCP | codedb CLI | ast-grep | ripgrep | grep | ctags
--- | --- | --- | --- | --- | --- | ---
Structural parsing | Yes | Yes | Yes | No | No | Yes
Trigram search index | Yes | Yes | No | No | No | No
Inverted word index | Yes | Yes | No | No | No | No
Dependency graph | Yes | Yes | No | No | No | No
Version tracking | Yes | Yes | No | No | No | No
Multi-agent locking | Yes | Yes | No | No | No | No
Pre-indexed (warm) | Yes | No | No | No | No | No
MCP protocol | Yes | No | No | No | No | No
Full-text search | Yes | Yes | Yes | Yes | Yes | No
Atomic file edits | Yes | Yes | Yes | No | No | No
File watcher | Yes | Yes | No | No | No | No

Architecture
Why codedb is fast

### MCP server

Indexes once on startup. All queries hit in-memory data structures with O(1) hash lookups. No filesystem access at query time.

### CLI tools

~55ms process startup + full filesystem scan on every invocation. Even simple queries pay the full cost.

### ast-grep

Re-parses all files through tree-sitter on every call. ~3ms for small repos, scales linearly with codebase size.

### ripgrep / grep

Brute-force scans every file on every call. ~5-7ms for small repos. No structural understanding, no index.

Methodology
Apple M4 Pro, 48GB RAM. MCP = pre-indexed warm queries (20 iterations avg).
CLI and external tools include process startup (3 iterations avg).
Ground truth verified against Python reference implementation.
View source on GitHub →
Get started GitHub