Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,27 +403,13 @@ Self-measured on every release via CI ([build benchmarks](generated/BUILD-BENCHM

| Metric | Latest |
|---|---|
| Build speed (native) | **1.9 ms/file** |
| Build speed (WASM) | **6.6 ms/file** |
| Build speed (native) | **2.1 ms/file** |
| Build speed (WASM) | **6.5 ms/file** |
| Query time | **2ms** |
| ~50,000 files (est.) | **~95.0s build** |
| ~50,000 files (est.) | **~105.0s build** |

Comment on lines 403 to 410
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automated benchmark script removed the "Lightweight Footprint" section that existed here. This is a bug in scripts/update-benchmark-report.js - the regex on line 220 matches the entire Performance section including subsections, but the replacement text doesn't preserve them. The script should either:

  1. Parse and preserve ### subsections within the Performance section
  2. Or use a more precise regex to only replace the benchmark table itself

The comment in the script (lines 218-219) says subsections "are preserved" but they're actually being deleted.

Metrics are normalized per file for cross-version comparability. Times above are for a full initial build — incremental rebuilds only re-parse changed files.

### Lightweight Footprint

<a href="https://www.npmjs.com/package/@optave/codegraph"><img src="https://img.shields.io/npm/unpacked-size/@optave/codegraph?style=flat-square&label=unpacked%20size" alt="npm unpacked size" /></a>

Only **3 runtime dependencies** — everything else is optional or a devDependency:

| Dependency | What it does | | |
|---|---|---|---|
| [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) | Fast, synchronous SQLite driver | ![GitHub stars](https://img.shields.io/github/stars/WiseLibs/better-sqlite3?style=flat-square&label=%E2%AD%90) | ![npm downloads](https://img.shields.io/npm/dw/better-sqlite3?style=flat-square&label=%F0%9F%93%A5%2Fwk) |
| [commander](https://github.com/tj/commander.js) | CLI argument parsing | ![GitHub stars](https://img.shields.io/github/stars/tj/commander.js?style=flat-square&label=%E2%AD%90) | ![npm downloads](https://img.shields.io/npm/dw/commander?style=flat-square&label=%F0%9F%93%A5%2Fwk) |
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) | WASM tree-sitter bindings | ![GitHub stars](https://img.shields.io/github/stars/tree-sitter/tree-sitter?style=flat-square&label=%E2%AD%90) | ![npm downloads](https://img.shields.io/npm/dw/web-tree-sitter?style=flat-square&label=%F0%9F%93%A5%2Fwk) |

Optional: `@huggingface/transformers` (semantic search), `@modelcontextprotocol/sdk` (MCP server) — lazy-loaded only when needed.

## 🤖 AI Agent Integration

### MCP Server
Expand Down
61 changes: 47 additions & 14 deletions generated/BUILD-BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Metrics are normalized per file for cross-version comparability.

| Version | Engine | Date | Files | Build (ms/file) | Query (ms) | Nodes/file | Edges/file | DB (bytes/file) |
|---------|--------|------|------:|----------------:|-----------:|-----------:|-----------:|----------------:|
| 2.4.0 | native | 2026-02-26 | 107 | 2.1 ↑11% | 1.6 ↑7% | 5.9 ~ | 9.5 ↑4% | 4517 ↑17% |
| 2.4.0 | wasm | 2026-02-26 | 107 | 6.5 ~ | 2.1 ~ | 5.9 ~ | 9.5 ↑4% | 4517 ↑17% |
| 2.3.0 | native | 2026-02-24 | 99 | 1.9 ~ | 1.5 ↑7% | 5.8 ↑7% | 9.1 ~ | 3848 ~ |
| 2.3.0 | wasm | 2026-02-24 | 99 | 6.6 ~ | 2.1 ↑11% | 5.8 ~ | 9.1 ↑3% | 3848 ~ |
| 2.1.0 | native | 2026-02-23 | 92 | 1.9 ↓24% | 1.4 ↑17% | 5.4 ↑6% | 9.1 ↓47% | 3829 ↓14% |
Expand All @@ -18,37 +20,68 @@ Metrics are normalized per file for cross-version comparability.

| Metric | Value |
|--------|-------|
| Build time | 183ms |
| Build time | 224ms |
| Query time | 2ms |
| Nodes | 575 |
| Edges | 897 |
| DB size | 372 KB |
| Files | 99 |
| Nodes | 630 |
| Edges | 1,018 |
| DB size | 472 KB |
| Files | 107 |

#### WASM

| Metric | Value |
|--------|-------|
| Build time | 649ms |
| Build time | 699ms |
| Query time | 2ms |
| Nodes | 575 |
| Edges | 897 |
| DB size | 372 KB |
| Files | 99 |
| Nodes | 630 |
| Edges | 1,018 |
| DB size | 472 KB |
| Files | 107 |

### Estimated performance at 50,000 files

Extrapolated linearly from per-file metrics above.

| Metric | Native (Rust) | WASM |
|--------|---:|---:|
| Build time | 95.0s | 330.0s |
| DB size | 183.5 MB | 183.5 MB |
| Nodes | 290,000 | 290,000 |
| Edges | 455,000 | 455,000 |
| Build time | 105.0s | 325.0s |
| DB size | 215.4 MB | 215.4 MB |
| Nodes | 295,000 | 295,000 |
| Edges | 475,000 | 475,000 |

<!-- BENCHMARK_DATA
[
{
"version": "2.4.0",
"date": "2026-02-26",
"files": 107,
"wasm": {
"buildTimeMs": 699,
"queryTimeMs": 2.1,
"nodes": 630,
"edges": 1018,
"dbSizeBytes": 483328,
"perFile": {
"buildTimeMs": 6.5,
"nodes": 5.9,
"edges": 9.5,
"dbSizeBytes": 4517
}
},
"native": {
"buildTimeMs": 224,
"queryTimeMs": 1.6,
"nodes": 630,
"edges": 1018,
"dbSizeBytes": 483328,
"perFile": {
"buildTimeMs": 2.1,
"nodes": 5.9,
"edges": 9.5,
"dbSizeBytes": 4517
}
}
},
{
"version": "2.3.0",
"date": "2026-02-24",
Expand Down