Rust Language Server Uses Compiler Output, Less RAM

Rust language server memory use compared with rust-analyzer

A new Rust language server called Rust Intelligence skips the work rust-analyzer repeats. It reads what the compiler already worked out during cargo check, stores it in an on-disk index and answers editor requests from there. In one measured session it peaked at 72 to 917 MB of memory, while rust-analyzer used 1.5 to 11.3 GB.

The project runs as a binary named ridx. The tool went public on 2026-11-19 and is now at release 0.3.8.

The idea behind the Rust language server

A cargo check already settles every name in a workspace, unfolds all the macros and works out the types. Then the editor’s language server does the same job again in its own memory. Pointed at Bevy, rust-analyzer reached 11.3 GB in the benchmark.

Rust Intelligence keeps the compiler’s answers instead. The ridx index command launches cargo check with ridx-driver wrapped around rustc. Once analysis finishes, the driver reads the compiler’s intermediate representation and its type results, then emits a .ridx shard for each crate. Each shard stores definitions, resolved references and types, along with impls, fields, generics, macros and imports.

Method calls and field accesses link to wherever rustc actually resolved them, including through auto-deref and trait selection, so nothing depends on guessing by name. Compilation then continues as normal, so the check result doesn’t change.

How the index stays small

Dependencies are indexed once per machine. Each dependency’s shard goes into a store addressed by content, with a key built from the crate, its version, the target, cfg flags and digests of its own build inputs. 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 only indexes its own crates.

The shard format is built to be read without parsing. Records are fixed size, little-endian and aligned to 8 bytes. The server memory-maps the files. A query becomes a hash probe, a binary search or a scan across mapped pages, and no record is ever decoded onto the heap. Untouched pages are never read, and under memory pressure the kernel can evict the rest.

Code typed between builds is matched to the compiled text line by line. A small front end called ridx-syntax, with its own lexer, parser, name resolution and type inference, analyzes the edited code and pulls everything else from the index. Saving a file triggers background reindexing, and any crate that fails to build retains its last working shard.

What the benchmark does and doesn’t show

The test used the same editor session against both servers. It opened 40 files of each repository one by one and asked for symbols, semantic tokens, folding ranges and inlay hints. Next came hover, go-to-definition, type definition, highlights, references and completion at sampled spots, followed by one edit.

The author lists limits. It was a single run, taken at commit f7105fcc on 2026-11-14, which predates releases 0.3.7 and 0.3.8, on Linux 6.8 with an AMD Ryzen 9 7950X and 64 GB of RAM. The rust-analyzer version wasn’t recorded.

  • The index build isn’t counted. It happens ahead of time and needs a few minutes on a big workspace at first, whereas rust-analyzer’s startup analysis counts toward its figures.
  • Rust Intelligence’s memory number counts index pages mapped from disk, and the kernel is free to drop and reload those. The rust-analyzer figure is its own heap.
  • rust-analyzer returned errors for 26 to 31 requests per repository and Rust Intelligence returned none, though the error types weren’t recorded.

The numbers show resource use on the same requests. They don’t show that the two servers gave identical answers. A separate suite checks agreement per LSP method, and it was not rerun for 0.3.7 or 0.3.8. The full 78-method matrix covers v0.2.0.

Installing it and the limits

It runs on Linux (x86_64 and arm64) and on macOS with Apple Silicon, through rustup. The installer brings in the Rust 1.98.1 toolchain that ridx-driver needs, fetches the release archive and verifies its SHA-256 checksum, then places ridx and ridx-driver in ~/.local/bin. From 0.3.8 on, macOS binaries carry a Developer ID signature and Apple notarization.

If no index exists, the server creates one the first time and shows progress in the editor. Run without a subcommand, ridx accepts rust-analyzer’s command line, so an editor configured for rust-analyzer can launch it instead. Zed has an extension, and VS Code needs the rust-analyzer extension’s server path setting set to ridx. Neovim and Helix have configurations in the docs, with the Helix one new in 0.3.8. That release also fixed workspace roots for editors that open a workspace member, as Helix does.

The same index also answers from the shell with commands such as ridx def, ridx refs and ridx hover. ridx compare sets an answer next to rust-analyzer’s.

The tradeoffs are real:

  • The driver is pinned to Rust 1.98.1 because it links against the compiler’s private libraries.
  • Answers come from the last build, so freshly typed code is answered from the open buffer until the next build.
  • Like cargo check, the index covers a single target and feature set.
  • Intel Macs aren’t built and Windows isn’t supported.
  • References into the standard library are searched in the workspace only, and std items can’t be renamed.

What to watch next

The memory savings make this Rust language server worth testing on large workspaces. Independent runs, a recorded rust-analyzer version and a rerun of the agreement suite on 0.3.8 would show whether the lower footprint costs any accuracy. The code is open source under MIT or Apache-2.0.

Source: !prod

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.