Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Performance

Shire is designed to index large monorepos quickly and answer queries instantly. This page documents benchmark methodology, results, and how to reproduce them.

Test repos

Benchmarks run against three real-world open-source monorepos covering a range of sizes and ecosystems:

RepoSizePackagesSymbolsFilesPrimary languages
turboreposmall40010,6865,451Rust, TypeScript, Go
grafanamedium2835,10414,054Go, TypeScript
kuberneteslarge3478,45818,275Go

Build performance

Full rebuild (no incremental cache), median of 4 iterations after a warmup run:

RepoMedianMinP95Std dev
turborepo571ms525ms678ms58ms
grafana1,150ms1,025ms1,172ms58ms
kubernetes1,703ms1,607ms1,897ms108ms

Build time scales roughly linearly with symbol count. The pipeline is parallelized with rayon across packages and files, with batched multi-row SQLite inserts within explicit transactions.

Incremental builds are significantly faster – only packages with changed source files are re-extracted, and an mtime pre-check skips SHA-256 computation entirely for untouched packages.

Query performance

Median latency over 100 iterations per query:

QuerySmallMediumLarge
search_symbols("parse")0.09ms0.09ms0.04ms
search_symbols("Config")0.20ms0.29ms1.01ms
search_files("mod")0.05ms0.03ms0.04ms
search_files("test")0.07ms0.60ms1.99ms
list_packages(None)0.11ms0.01ms0.01ms

All queries use SQLite FTS5 full-text search with unicode61 tokenizer and prefix indexes. Query latency depends primarily on result set size, not total index size.

Reproducing benchmarks

Shire includes an autoresearch binary for reproducible benchmarking.

Setup

Run the benchmark repo setup script to clone and prepare the test repos:

scripts/setup-bench-repo.sh

This clones the three repos into ~/.cache/shire-bench/ and creates a shire.toml in each.

Running benchmarks

# Build the benchmark binary
cargo build --release --bin autoresearch

# Run build benchmarks (all repos)
cargo run --release --bin autoresearch -- --phase build

# Run query benchmarks (all repos)
cargo run --release --bin autoresearch -- --phase query

# Filter by repo size
cargo run --release --bin autoresearch -- --phase build --size small

# Point at a specific repo
cargo run --release --bin autoresearch -- --phase build --repo /path/to/repo

Build benchmarks run 5 iterations (1 warmup + 4 measured) per repo. Query benchmarks run 100 iterations per query. Results are printed as JSON to stdout.

Environment notes

  • Results vary by machine (CPU, disk speed, available memory)
  • Close other applications for more stable measurements
  • The warmup iteration primes filesystem caches and SQLite page cache
  • Numbers in this document were captured on an Apple M-series Mac