ridxridx.v0.3.7

Rust code intelligence at a tenth of the memory.

ridx is a language server for Rust that answers from what rustc already worked out. It records definitions, references and types once during cargo check and reads them straight from disk, so your editor gets navigation, hover and completion without a second compiler in RAM.

~/src/tokio
# as a language server: Zed, VS Code, Neovim, Helix
$ ridx lsp
  no index yet? it builds one, with progress

# or ask from the shell
$ ridx def . tokio::runtime::Builder
$ ridx refs . src/main.rs:12:15
$ ridx hover . src/main.rs:12:15
The idea

The compiler already knows the answers

GBsrust-analyzer keeps its own analysis of the whole workspace in memory: 1.5 to 11.3 GB in our run, from serde to Bevy.
TwiceThat analysis repeats work rustc does anyway on every cargo check: name resolution, macro expansion, type inference.
DepsMost of what is analyzed is crates.io dependencies and std, code nobody edits. ridx indexes each dependency once and shares it between projects.
LiveUnsaved edits are answered from an in-memory overlay on top of the index, so code you are typing still navigates, hovers and completes.
Measured

Same editor session, two servers

Each server opened the same 40 files of a repository and answered the same requests: symbols, highlighting, folding, inlay hints, then hover, definition, type definition, highlights, references and completion at sampled positions, and an edit. Memory includes child processes.

Latency, ms (p50 / p95) · requests that came back with an error are included
What is not countedridx answers from an index built beforehand by ridx index (a cargo check with the ridx driver). That build takes minutes on a large workspace the first time; dependencies are then shared by every project on the machine. rust-analyzer analyzes the workspace each time it starts, and that time is in its numbers.
What “ready” meansFor ridx: the reply to initialize; caches keep warming in the background after it. For rust-analyzer: the moment it reports that analysis is done, plus 0.5 s without messages to be sure.
How to read memoryridx's memory includes index pages mapped from disk. The kernel can drop them under pressure and read them again later. rust-analyzer's memory is its own heap.
Reproduce itScript: bench/measure_resources.py. Raw results: jsonl. One run (n = 1) on Linux 6.8, AMD Ryzen 9 7950X, 64 GB, the two servers one after another. The harness counts a request as an error when the server replies with one; their kinds were not recorded.
Architecture

What runs where

Two things live in memory: the language server and your unsaved buffers. Everything else is files on disk, mapped on demand. Click any part.

editor
ridx process
disk · page cache
build time
How an index is built and queried
01cargo checkridx-driver runs as the rustc wrapper. rustc resolves everything as it normally would.
02Write shardsDefinitions, references and types for each crate go into a compact .ridx v5 file.
03Store by hashDependencies land in the global CAS once; your crates go to the workspace variant.
04Map and queryQueries mmap the shards and binary-search sorted tables. No parse, no copy, no daemon.
The .ridx v5 file

Little-endian, 8-byte aligned, fixed-size records. Lookups are binary searches over sorted tables in mapped memory — nothing is parsed or copied into the heap.

Trade-offs

What to know before you switch

Answers come from the last buildNavigation, references and types come from what rustc recorded. Code typed since then is answered from the open buffer and catches up when the project builds again; a crate that fails to build keeps its last good index.
The active cfg onlyLike cargo check, the index sees one target and one feature set. Code behind other #[cfg]s or features is not indexed.
First index takes a buildThe first time, ridx runs cargo check with its driver: minutes on a large workspace. Dependencies are indexed once and shared by every project on the machine.
Linux and macOSWindows is not supported yet. ridx-driver links to the Rust 1.98.1 compiler, so keep that toolchain installed; your own projects can use any toolchain.
LSP 3.18

One server, every capability your editor asks for

CATEGORY
METHODS
Quickstart

One command, then point your editor at it

Linux (x86_64, arm64) and macOS on Apple Silicon, with rustup. The installer adds Rust 1.98.1, the compiler ridx-driver runs on (your projects keep their own toolchain), checks the release archive's SHA-256 and puts ridx and ridx-driver into ~/.local/bin. Open a Cargo workspace and ridx indexes it on first use; your editor shows the progress.

curl -fsSL https://rust-intelligence.com/install.sh | sh

Prefer to build it? rustup toolchain install 1.98.1 --component rustc-dev,llvm-tools-preview,rust-src, clone the repository and cargo +1.98.1 install --locked --path crates/ridx and --path crates/ridx-driver. If a desktop editor cannot find ridx, give it the full path from which ridx.