We benchmarked IWE on 20,000 documents. Here's what we found.
How fast is a plain-Markdown knowledge graph at scale? We generated 20,000 documents and measured. Load: under a second. Most queries: under 20 milliseconds.
One question keeps coming up: “How does IWE handle a big knowledge base?” Fair question — if your tool chokes at a few thousand files, it’s a toy. (IWE turns a folder of Markdown into a queryable graph; if that model is new to you, start with Markdown as a database.)
So we built a proper benchmark. We generated 20,000 Markdown files with frontmatter, inclusion links, inline references, headers, and paragraphs — a realistic knowledge base, just bigger than most people will ever need. Then we measured two things: how long it takes to load all those files into memory, and how long it takes to query them once loaded.
Load time
| Documents | Time |
|---|---|
| 5,000 | 128 ms |
| 10,000 | 285 ms |
| 20,000 | 631 ms |
20,000 files parsed and turned into a graph in under a second. This is the cost you pay once — the LSP server and MCP server load the graph at startup and keep it in memory, so every subsequent action (completions, code actions, queries) skips this step entirely.
For CLI users: every iwe find or iwe count invocation pays this cost before running the query. Even at 20k files, you’re looking at well under a second for the whole round trip.
Query time
Once the graph is loaded, queries are fast. Here’s a sample at 20,000 documents:
| What | Time |
|---|---|
Filter by a field (status: draft) | 12 ms |
| Find with full output | 15 ms |
| Count matching docs | 18 ms |
| Retrieve with backlinks | 7 ms |
| Stats across all docs | 30 ms |
| Traverse inclusion tree (unbounded) | 48 ms |
Most operations finish in under 20 milliseconds. That’s fast enough to feel instant in an editor — no loading spinners, no lag between keystrokes and results.
The slowest operation (traversing the full inclusion tree from a hub that reaches 94% of the corpus) still comes in under 50 ms. In practice, you’d rarely traverse unbounded like that.
What this means for you
- Your 500-file Zettelkasten? Loads in tens of milliseconds. Queries are sub-millisecond.
- A 5,000-doc project? Everything stays under 130 ms. You won’t notice it.
- An ambitious 20,000-file knowledge base? Still under a second to load, and queries feel instant.
The LSP and MCP servers are even better off — they load once and stay in memory. Every code action, every completion, every agent query hits a warm graph. There’s no cold start per operation.
What we didn’t benchmark
We only measured the read path — loading files and querying the graph. We didn’t benchmark the LSP server end-to-end (that adds protocol overhead) or mutating commands like update, extract, inline (they write to disk and aren’t the bottleneck).
The corpus is synthetic but realistic: each doc has frontmatter with 5 fields, 3 inclusion links, 2 sections, 6 paragraphs, and 6 inline references. One hub document links to a tenth of the corpus, creating a dense graph for traversal benchmarks.
On scaling patterns: most operations scale roughly linearly with document count. Two exceptions — the roots filter and unbounded inclusion traversal — scale super-linearly because they walk the full edge set. Neither is a common query pattern, but it’s something we’re aware of and planning to optimize.
Try it yourself
The benchmark is fully reproducible. If you have the repo cloned:
cargo bench -p iwe
It generates a deterministic corpus (same files every time), runs both stages, and produces an HTML report. Full details on the methodology — corpus shape, harness config, how to read the output — are on the benchmark page.