release · · 5 min

Rust Intelligence: A Rust Language Server That Reads the Compiler's Answers

Rust Intelligence records what rustc resolved during cargo check into an on-disk index and answers the editor from it. In one measured session: 72–917 MB of peak memory against rust-analyzer's 1.5–11.3 GB.

On this page · 5 sections
  1. How it works
  2. Measured
  3. Install and editors
  4. Limits
  5. Links

Every cargo check already resolves every name in a Rust workspace, expands every macro and infers every type. Then the editor’s language server does all of that a second time, in its own memory. On Bevy, rust-analyzer held 11.3 GB in the run below.

Rust Intelligence is a Rust language server, run as the ridx binary, that keeps what the compiler worked out instead of computing it again. It has been public since 2026-11-19; the current release is 0.3.8.

How it works

How Rust Intelligence 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.
Build time on the left, edit time on the right. Diagram from the Rust Intelligence architecture document.

The compiler writes the index. ridx index runs cargo check with ridx-driver as the rustc wrapper. After analysis the driver walks the HIR and rustc’s type-check results and writes one .ridx shard per crate: definitions, every resolved reference, types, impls, fields, generics, macros and use items. Method calls and field accesses point where rustc resolved them, through auto-deref and trait selection, not at a guess by name. Compilation then continues as usual, so the result of the check is unchanged.

Dependencies are indexed once per machine. A dependency’s shard goes to a content-addressed store, keyed by crate, version, target, cfg flags and the digests of what it was compiled against. Every project and worktree on the machine shares those shards, and std, core and alloc are indexed once per toolchain. A second worktree of the same project indexes only its own crates.

Reading is mapping, not parsing. A shard is little-endian, with fixed-size records in sections aligned to 8 bytes: a string pool, files, definitions with a hash index, references sorted by span with a hash index by target, and tables of types, impls, fields and generics. The server maps the files; a lookup is a hash probe, a binary search or a scan over mapped pages, and the records are never decoded into the heap. Pages nobody asks for are never read, and the kernel can drop the others under memory pressure.

Code typed between builds is mapped onto the compiled text line by line, and the edited code is analysed by a small compiler-free front end (ridx-syntax: lexer, parser, name resolution, type inference) that reads every other item and type from the index. After a save the server reindexes in the background; a crate that fails to build keeps its last good shard.

Measured

The same editor session against both servers: 40 files of each repository opened one by one, with document symbols, semantic tokens, folding and inlay hints, then hover, definition, type definition, document highlight, references and completion at sampled positions, and an edit. Memory includes child processes.

Repository Peak memory, Rust Intelligence / rust-analyzer CPU for the session Start until ready
serde 72 MB / 1.5 GB 2.34 s / 6.97 s 0.06 s / 3.27 s
tokio 221 MB / 3.2 GB 1.90 s / 35.9 s 0.24 s / 4.77 s
rust-analyzer 434 MB / 4.6 GB 4.44 s / 66.7 s 0.64 s / 5.22 s
bevy 917 MB / 11.3 GB 5.38 s / 170.5 s 1.26 s / 15.5 s

What this run is, and what it is not:

  • One run (n = 1) of Rust Intelligence at commit f7105fcc (2026-11-14), before the 0.3.7 and 0.3.8 releases, on Linux 6.8 with an AMD Ryzen 9 7950X and 64 GB. The rust-analyzer version was not recorded. The raw results are resources_f7105fcc.jsonl and the script is measure_resources.py; memory is in binary units (the script divides kilobytes by 1024).
  • The index build is not counted. Rust Intelligence answers from an index built beforehand, which takes minutes on a large workspace the first time. rust-analyzer analyses the workspace each time it starts, and that time is in its numbers.
  • “Ready” is the reply to initialize for Rust Intelligence, whose caches keep warming in the background after it; for rust-analyzer, the end of its analysis plus 0.5 s without messages.
  • Rust Intelligence’s memory includes index pages mapped from disk, which the kernel can drop and read again; rust-analyzer’s is its own heap.
  • rust-analyzer replied with an error to 26–31 requests per repository and Rust Intelligence to none; the kinds of errors were not recorded, and errored requests are included in the latency figures.

These numbers say how much memory and CPU each server spent on the same requests. They do not say the answers were the same. Agreement with rust-analyzer per LSP method is measured with a separate suite in the repository, and that suite was not re-run for 0.3.7 or 0.3.8: the full 78-method matrix is for v0.2.0, in docs/BENCHMARK_MATRIX.md.

Install and editors

On Linux (x86_64, arm64) and macOS on Apple Silicon, with rustup:

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

The installer adds the Rust 1.98.1 toolchain that ridx-driver runs inside (it links to that compiler’s libraries; your projects keep their own toolchain), downloads the release archive for the platform from GitHub, checks its SHA-256 and puts ridx and ridx-driver into ~/.local/bin. Since 0.3.8 the macOS binaries are signed with a Developer ID and notarized by Apple.

Then open a Cargo workspace. With no index yet, Rust Intelligence builds one on first use and reports progress to the editor. ridx with no subcommand accepts rust-analyzer’s command line, so an editor set up for rust-analyzer can start it instead:

  • Zed: an extension in editors/zed registers ridx lsp.
  • VS Code: point the rust-analyzer extension at it with "rust-analyzer.server.path": "ridx".
  • Neovim and Helix: configurations in docs/editors/; the Helix one is new in 0.3.8. 0.3.8 also fixed the workspace root: an editor that opens a workspace member as the root, as Helix does, now gets the whole Cargo workspace.

The same index answers from the shell: ridx def, ridx refs, ridx hover, ridx type-at, ridx symbols, and ridx compare, which puts an answer side by side with rust-analyzer’s.

Limits

  • The driver needs Rust 1.98.1. It links to the compiler’s private libraries, so it is pinned to one toolchain; the installer adds it.
  • Answers come from the last build. Code typed since then is answered from the open buffer and catches up when the project builds again.
  • One cfg. Like cargo check, the index sees one target and one feature set; ridx index --all-features and --target choose them.
  • Platforms: Linux x86_64 and arm64, and macOS on Apple Silicon. Intel macOS is not built, and Windows is not supported.
  • The standard library: navigation and hover into std, core and alloc work; references to them are searched in the workspace only, and they cannot be renamed.
Cite this article
Citation
Alexander Panasenko (2026-11-19). Rust Intelligence: A Rust Language Server That Reads the Compiler's Answers. https://prod.codes/blog/rust-intelligence-a-rust-language-server-that-reads-the-compilers-answers/