ridx-driver 0.3.22

Compiler-backed rustc_driver extractor for Rust Intelligence (ridx)
ridx-driver-0.3.22 is not a library.

ridx records definitions, references and types once, during cargo check, into a binary index, and reads that index straight from disk. Your editor gets navigation, hover, completion, references and rename without a second compiler held in memory.

Linux, macOS and Windows. Not affiliated with the Rust Project or the Rust Foundation.


Why

  • rust-analyzer keeps its own analysis of the whole workspace in memory: 1.4 GB on serde and 11.0 GB on Bevy in the run below. It repeats name resolution, macro expansion and type inference that rustc performs anyway on every cargo check.
  • Most of what is analyzed is dependencies and std, code nobody edits. ridx indexes each dependency once and shares it between every project and worktree on the machine.
  • What you are typing still works: unsaved edits are answered at once from an in-memory overlay on top of the index, and 250 ms after the last edit the edited crates are compiled from the buffers into an index of the session, so references and rename see the new code too, and the compiler's errors in it are reported.

Measured

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

Repository Server process, ridx / rust-analyzer Peak with child processes CPU for the session Start until ready
serde 82 MB / 1.4 GB 507 MB / 1.4 GB 4.10 s / 7.18 s 0.12 s / 3.32 s
tokio 225 MB / 3.2 GB 225 MB / 3.3 GB 2.58 s / 38.1 s 0.41 s / 5.97 s
rust-analyzer 468 MB / 4.3 GB 3.0 GB / 4.4 GB 36.4 s / 57.5 s 0.91 s / 5.53 s
bevy 940 MB / 10.8 GB 7.4 GB / 11.0 GB 72.8 s / 215.9 s 1.42 s / 16.4 s
  • ridx 0.3.16 and rust-analyzer 1.98.1, 2026-11-27; two runs on Linux 6.8, AMD Ryzen 9 7950X, 64 GB, the servers one after the other. Shown is the second, which records the server process apart from its children. Raw results: bench/published/resources_v0.3.16_ram9_pass2.jsonl, the first run: …_pass1.jsonl, script: bench/measure_resources.py; per-method latency is in the raw results and on the site.
  • Not counted: ridx answers from an index built beforehand (ridx index, a cargo check with the ridx driver), which takes minutes on a large workspace the first time. rust-analyzer analyzes the workspace each time it starts, and that time is in its numbers.
  • "Ready" is the reply to initialize for ridx (caches keep warming in the background after it) and, for rust-analyzer, the end of its analysis plus 0.5 s without messages.
  • Memory: ridx's figure includes index pages mapped from disk, which the kernel can drop under pressure and read again. rust-analyzer's is its own heap.
  • Compiler runs are in ridx's peak, not in rust-analyzer's: ridx starts cargo check for diagnostics and compiles the edited crate after each edit, and the session edits all 40 files, so its peak includes those processes; they end a few seconds after the last edit. rust-analyzer runs cargo check only on save, and the session saves nothing.
  • rust-analyzer replied with an error to 26–31 requests per repository, ridx to none; the kinds were not recorded. Errored requests are included in the latency figures.

Agreement of the answers with rust-analyzer per LSP method is measured with the suite in bench/ and recorded per release in CHANGELOG.md. The full 78-method matrix of v0.2.0 is in docs/BENCHMARK_MATRIX.md and LSP_BENCHMARK_COMPARISON_REPORT.md.


Install

Linux (x86_64, arm64), macOS (Apple Silicon, Intel) and Windows (x86_64), with rustup:

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

On Windows, in PowerShell:

powershell -ExecutionPolicy Bypass -c "irm https://rust-intelligence.com/install.ps1 | iex"

The installer adds Rust 1.98.1, the toolchain ridx-driver runs inside (it links to that compiler's libraries; your own projects keep any toolchain, ridx runs the index build with the right one), downloads the release archive for your platform from GitHub, checks its SHA-256 and puts ridx and ridx-driver into ~/.local/bin (%USERPROFILE%\.local\bin on Windows, added to your PATH; RIDX_INSTALL_DIR changes it, RIDX_VERSION=v0.3.14 pins a release).

Or from crates.io. Build both binaries with Rust 1.98.1: ridx-driver links that compiler's own libraries, so it needs rustc-dev and these two flags, and ridx runs the index build on the toolchain it was built with. From a checkout, add --path crates/ridx and --path crates/ridx-driver instead of the crate names.

rustup toolchain install 1.98.1 --profile minimal --component rustc-dev,rust-src
cargo +1.98.1 install ridx
RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C prefer-dynamic" cargo +1.98.1 install ridx-driver

Then open a Cargo workspace in your editor. With no index yet, ridx builds one on first use and reports progress to the editor; it reloads the index when the build finishes and reindexes in the background after saves. ridx index . builds it from the shell (--all-features, --target <triple> choose the cfg).

If a desktop editor cannot find ridx, give it the full path from which ridx.

Editors

ridx with no subcommand behaves as rust-analyzer on the command line (--version, --stdio, --log-file, --print-config-schema), so an editor set up for rust-analyzer can start it instead.

From the shell

ridx index .                     # build or refresh the index
ridx def . my_crate::run         # go to definition, by path or file:line:col
ridx refs . src/main.rs:12:15    # references across the workspace and its dependencies
ridx hover . src/main.rs:12:15
ridx type-at . src/main.rs:12:15
ridx symbols . Config
ridx inspect .                   # shards, crates and record counts
ridx compare -c all . my_crate::run   # side by side with rust-analyzer

LSP methods

Category Methods
Navigation definition, declaration, implementation, typeDefinition
References references, documentHighlight
Intelligence hover, completion (with auto-import), signatureHelp, inlayHint, semanticTokens
Hierarchies prepareCallHierarchy, incomingCalls, outgoingCalls, prepareTypeHierarchy, supertypes, subtypes
Refactoring prepareRename, rename, codeAction (compile-safe assists), executeCommand
Formatting formatting, rangeFormatting
Symbols documentSymbol, workspace/symbol
Diagnostics publishDiagnostics from a background cargo check on save and from the compile of unsaved buffers, pull diagnostics
Workspaces didChangeWorkspaceFolders, didChangeWatchedFiles, multi-root

How it works

rustc already resolves every name, expands every macro and infers every type on each cargo check. ridx keeps those answers instead of computing them again.

  • 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 (method calls and fields as rustc resolved them, through auto-deref and trait selection), types, impls, fields, generics, macros and use items. Compilation then goes on as usual, so the check itself 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; when a valid shard is there, the driver does not extract the crate again. Projects and worktrees share these shards, and std, core and alloc are indexed once per toolchain.
  • Reading is mapping, not parsing. The v5 shard is little-endian, with fixed-size records in sections aligned to 8 bytes: a string pool, files (16 B), definitions (40 B) with an FNV-1a hash index, references sorted by span (48 B) with a target hash index, and type, impl, field and generic tables. A lookup is a hash probe, a binary search or a scan over mapped pages. Pages nobody asks for are never read, and the kernel can drop the others under memory pressure.
  • Rebuilds are incremental and safe. After a save the server reindexes in the background; when only workspace sources changed, it calls the driver on the changed crates directly, without Cargo. A crate with compile errors is indexed from everything that resolved; one the compiler cannot take that far (a syntax error) keeps its last good shard. Another feature set or target gets its own variant next to the first.
  • Code typed between builds is mapped onto the compiled text line by line, and the edited code is analyzed by a small compiler-free front end (crates/ridx-syntax: lexer, parser, name resolution, type inference) that reads every other type and item from the index. 250 ms after the last edit, the crates owning the edited buffers are compiled from their text into an index of the session (nothing is written to the files), which answers references, rename and navigation until the next build.

The whole design, with the shard layout and where each part lives in the code: docs/ARCHITECTURE.md.

Known limitations

  • Unsaved code reaches the index with a delay. The edited crates are compiled from the buffers 250 ms after the last edit, which takes from a fraction of a second to a few seconds for a large crate; until then references and navigation come from the previous index, mapped through the edit. Crates that depend on an edited one see the change after a save.
  • One cfg. Like cargo check, the index sees one target and one feature set; code behind other #[cfg]s or features is not indexed. Choose them with ridx index --all-features / --target.
  • Prebuilt binaries cover Linux x86_64 and arm64, macOS on Apple Silicon and Intel, and Windows x86_64; elsewhere, install from crates.io.
  • 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.
  • vec![] counts as a reference to Vec; rust-analyzer does not count it.

Development

Every source file stays at or under 400 lines.

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

Citing

If you use ridx in research or documentation, please cite the archived release on Zenodo: 10.5281/zenodo.24379816 for the project (it resolves to the latest version), 10.5281/zenodo.24741377 for exactly 0.3.20. CITATION.cff holds the metadata GitHub's "Cite this repository" uses.

@software{panasenko_2026_24741377,
  author    = {Panasenko, Alexander},
  title     = {Rust Intelligence (ridx) — a Rust language server answering from a compiler-built on-disk index},
  month     = dec,
  year      = 2026,
  publisher = {Zenodo},
  version   = {0.3.20},
  doi       = {10.5281/zenodo.24741377},
  url       = {https://doi.org/10.5281/zenodo.24741377},
}

License

Licensed under either of:

at your option.