v0.6.9

⚡ fast_code_search

Code search that ranks like code: definitions above usages, widely imported files first, from an in-memory trigram index.
Trigram indexing · Tree-sitter symbol awareness · Millisecond search · gRPC + REST APIs

Two Search Engines, One Platform

Choose the right tool for the query — or use both together

🔍

Keyword Search

Port 8080 / gRPC 50051

Trigram-indexed, AST-aware search. Zero cold-start. Best for exact code patterns, function calls, and variable names.

  • Roaring bitmap trigram index
  • Tree-sitter symbol extraction (12 languages)
  • PageRank-style import graph scoring
  • Regex with trigram acceleration
  • Parallel search via rayon
  • File watcher & incremental indexing
  • Index persistence (disk save/load)
  • Symbols-only search mode

fn main · class.*Handler · import useState

🧠

Semantic Search

Port 8081 / gRPC 50052 · optional

Understands code meaning. Best for natural language queries that don't map to exact token matches.

  • TF-IDF (fast, zero dependencies)
  • CodeBERT / UniXcoder ML embeddings
  • HNSW vector index for similarity search
  • Code-aware chunking (functions, classes)
  • ONNX Runtime inference
  • Model SHA-256 integrity checks

"retry with exponential backoff" · "validate user input"

Why fast_code_search?

Unlike CLI tools or disk-based indexes, it runs as an always-on, in-memory server

🚀

Milliseconds, from memory

The index stays hot in RAM, so a query never waits on disk: about 1 ms at the median over tokio + Django in CI, and microseconds when nothing matches.

📦

Ranked like code

Definitions outrank usages, files the codebase imports outrank the ones it doesn't, phrases outrank scattered terms, and references (call sites, type mentions) are a first-class query.

⚙️

Symbol Awareness

Tree-sitter parses Rust, Python, JS/TS, Go, C/C++, Java, C#, Ruby, PHP, Bash and more.

📡

Dual API

gRPC streaming (tonic) for IDE plugins. REST/JSON (axum) for scripts and web UIs.

📈

Smart Scoring

Symbol defs (3×), exact match (2×), src/lib dirs (1.5×), PageRank import boost.

🔄

Live Indexing

File watcher tracks filesystem changes. Incremental re-indexing keeps the index fresh.

💾

Index Persistence

Save the full index (v3 format with symbols & deps) to disk. Checkpoints during large builds.

🌐

Embedded Web UI

Browser-based search on port 8080. Static assets compiled into the binary — zero deployment friction.

Test Results

Tested on every push and pull request across Linux, Windows, and macOS

Suite ubuntu-latest windows-latest macos-latest
cargo build ✅ ✅ ✅
cargo test ✅ ✅ ✅
cargo clippy ✅ — —
cargo fmt ✅ — —
cargo llvm-cov ✅ — —
validator --json ✅ — —

Status is updated on every push to main. View full run history →

Performance Benchmarks

Criterion benchmarks tracked over time — historical trend data powered by github-action-benchmark

0.95 ms
p50 text search, tokio + Django (6,237 files)
1,460 files/s
Index build, symbols included
118 MB
Resident for 38.9 MB of source
12
Languages with symbol ranking

From benchmark run 34254363545 (commit f46e7bf, GitHub-hosted ubuntu-latest); the README carries the full table.

search_benchmark

Text search, regex search, filtered search across synthetic and real corpora. Measures throughput and latency percentiles.

persistence_benchmark

Save/load index, trigram deserialization, file staleness checks. Validates startup time at scale.

Validator (functional)

200-file synthetic corpus. Verifies index completeness, line number accuracy, symbol extraction, path filtering, and query correctness.

Open full benchmark dashboard in new tab →  |  Latest benchmark run →

Code Coverage

Generated via cargo-llvm-cov on every CI run

Coverage sunburst

View detailed coverage on Codecov →

How to generate locally

# Install (one-time)
cargo install cargo-llvm-cov
rustup component add llvm-tools-preview

# Generate HTML report and open it
cargo llvm-cov --all-features --workspace --open

# Generate LCOV for IDE integration
cargo llvm-cov --all-features --workspace \
  --lcov --output-path lcov.info

HTML reports are also available as a coverage-report artifact on each CI run.

Recent Releases

Full CHANGELOG →

v0.6.9 2026-02-28 Release notes →

Version bump and release.

v0.6.8 2026-02-28 Release notes →

Automated performance benchmarks in CI with historical trend tracking. Registered persistence_benchmark in Cargo.toml.

v0.6.7 2026-02-27 Release notes →

Code coverage via cargo-llvm-cov. Fixed API handlers blocking under concurrent load (503 instead of deadlock).

v0.6.6 2026-02-27 Release notes →

Fixed OOM during large-codebase indexing: compact_memory(), finalize() shrink-to-fit, TrigramIndex::finalize().

v0.6.5 2026-02-27 Release notes →

Fixed content_fallback bytes permanently retained in heap. Persist symbol caches and import graph in saved index (format v3).

Getting Started

1

Install from source

git clone https://github.com/jburrow/fast_code_search.git
cd fast_code_search
cargo build --release
2

Configure

# Generate a default config file
./target/release/fast_code_search_server --init config.toml

# Edit to point at your codebase
# [indexer]
# paths = ["/path/to/your/repo"]
3

Run

./target/release/fast_code_search_server --config config.toml

# Web UI available at http://localhost:8080
# gRPC available at localhost:50051
4

Search

# REST API
curl "http://localhost:8080/api/search?q=fn+main&max=10"

# Symbols only
curl "http://localhost:8080/api/search?q=SearchEngine&symbols=true"

# Regex
curl "http://localhost:8080/api/search?q=async+fn.*Handler®ex=true"