ridxridx.v0.3.13

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.

How ridx works: at build time cargo check runs ridx-driver inside rustc and writes .ridx shards to disk; at edit time ridx lsp maps them and answers the editor

The whole design, request by request, with pointers into the code: Documentation → Architecture.

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 shared store once; your crates go to the workspace variant.
04Map and queryThe server maps the shards and answers with hash probes, binary searches and scans over them. Records are read in place, never decoded into the heap.
The .ridx v5 file

Little-endian, fixed-size records in 8-byte aligned sections. A lookup is a hash probe, a binary search or a scan over mapped memory; records are read in place, never decoded 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

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? From crates.io: rustup toolchain install 1.98.1 --profile minimal --component rustc-dev,rust-src, then cargo +1.98.1 install ridx and RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C prefer-dynamic" cargo +1.98.1 install ridx-driver (the driver links the compiler's own libraries). If a desktop editor cannot find ridx, give it the full path from which ridx.