Magic Tools
Developer ToolsBy CooconAugust 23, 2026130 views3 min read

Someone spent 4 months building a Rust LSP that uses 100x less memory

Someone spent 4 months building a Rust LSP that uses 100x less memory

If you write Rust on an 8GB MacBook, you know the drill: open the project, fans spin up, rust-analyzer chews through a few gigabytes of RAM, and Chrome starts swapping. Everyone complained about it for years. Nobody actually did anything about it.

Until someone spent four months building a replacement.

The numbers first

Rust Glancer is a from-scratch alternative to rust-analyzer, built by one developer in four months, with one goal: keep the language server under 100MB of memory.

Measured on the author's own machines:

  • 8GB M1 MacBook Pro (2020): full indexing in 9 seconds — rust-analyzer needs 14. RAM stays under 100MB the whole time.
  • M4 Max 36GB: 8 seconds vs rust-analyzer's 13.

Not "a bit better". Two orders of magnitude less memory. The project hit 392 points on Hacker News, and the heaviest endorsement comes from matklad, rust-analyzer's own author. He wrote a commentary calling it "incredibly cool" — and casually admitted something uncomfortable about his own project: rowan, the syntax tree library he chose, "is garbage :P".

The core idea: skip incremental, freeze the analysis

Why does rust-analyzer eat so much RAM? The Glancer author breaks it into three parts:

  1. Rust workspaces genuinely have a lot of information to index. That one's unavoidable.
  2. Salsa, the incremental query database — cool approach, but data is inherently stuck in memory.
  3. Rowan, the syntax tree — bought partial invalidation (reparse only the changed line) at the cost of heavy memory fragmentation.

Glancer throws all of that out: no incremental computation. Just a frozen analysis result that gets invalidated on save.

Sounds like a downgrade, but it buys two properties:

  • Glancer can shove analysis results out to the filesystem and load them back only when a query asks.
  • Restarting your editor doesn't trigger re-indexing — the results are already on disk.

Think of rust-analyzer as a library that spreads every book across the table, ready to grab. Glancer shelves everything and fetches the one book you ask for. Slightly slower per query, but the table stays clean.

Glancer is clever about typing, too: no full analysis per keystroke — just a shallow pass over the current function body, reusing the last complete index. The trade-off: new imports, structs, and traits don't get indexed until you save.

matklad's own admission: 1% use case, 99% sacrifice

matklad's commentary is worth reading beyond the endorsement. Rowan was designed for incremental parsing and DOM-style refactoring, he says — "but that's 1% use case. The 99% use case is all the code in your 6666 dependencies which you won't ever look at, but which needs to be at least shallowly analyzed."

He sketches a bigger vision too: IntelliJ's PSI is an interface, not an implementation. Files open in the editor get concrete syntax trees; the rest of the project gets compact stub trees (no function bodies); dependencies are served straight from compiled .rmeta files. rust-analyzer should only switch to full analysis when you actually start poking around ~/.cargo/registry.

That iceberg architecture — incremental analysis only at the tip, everything else read-only, compact, and on disk — nobody has finished building it. Glancer is a step in that direction.

Don't uninstall rust-analyzer yet

Cold water time. Glancer is not a complete LSP: missing features, known bugs, and hard problems like proc-macro expansion are basically off the table. The author says it plainly: Glancer will never become "rust-analyzer, but better". It's for people with weak machines, or people willing to trade some completeness for RAM.

There's one unexpected win for agentic workflows, though: it ships a custom file watcher where out-of-editor changes get lower priority. When an agent bulk-edits your code, you don't get a re-indexing storm, and inlay hints don't drift out of place — a bug matklad admits rust-analyzer itself struggles with.

What you can do today

  • On an 8GB machine: install the VS Code extension and try it. Worst case you uninstall in five minutes.
  • Memory isn't your problem: file away "frozen analysis + on-demand loading". It applies to any memory-hungry indexing tool — language servers, CI caches, search indexes.
  • Spare 15 minutes: read matklad's commentary in full. It's a textbook architecture retrospective.

✨ Originally drafted by DeepSeek, reviewed and polished by Claude.

Sources:

Related Articles

Dev Breakfast · 2026-10-07

Today's headline: The same $200 Claude plan: what it's worth depends on which model you run. Plus 4 more: Vibe coding isn't as fun as hand-writing code: a viral HN post spells out 'frontloading the fun'; Mistral Large 4 opens preview: 1T params, 49B active, weights not out until month-end; and more.

daily-intelOct 7, 202611 min
37

Dev Breakfast · 2026-10-06

Today's headline: Wikipedia Looked Into OpenAI's Agent: Changed Configs, Probed for Holes, Crawled Millions of Pages. Plus 2 more: Opus 5.5 Found Two Room-Temperature Magnetic Semiconductors, But One Can't Be Synthesized; Beam Open-Sources 501B Weights: 23B Active, But the Weights Aren't Out Yet.

daily-intelOct 6, 20268 min
96

Dev Breakfast · 2026-10-05

Today's headline: macOS 27 kills the Apple Intelligence master switch: one script helps you evict the models. Plus 2 more: A 125B model running on a 12G GPU: up to 94 tokens/s in the official table; pstack ported to 6 coding Agents: Cursor's workflow has been carried over.

daily-intelOct 5, 20266 min
112

LM Studio Slow on a Mac? Tested: the 39-Second Wait Is Prompt Prefill, Not GPU Offload

LM Studio with gemma-4-e4b (Q4_K_M) on a 24GB M4 Mac mini: generation runs about 29.5 tok/s, and turning GPU offload from max to off costs only 11%. What really feels slow is prompt prefill — a 13K-token prompt waited 39.4 seconds for the first token (about 330 tokens/s), and 3.4–3.7x longer on CPU. A second request with the same prefix got its first token in 0.1 s thanks to prefix caching. With --parallel 4 and four simultaneous requests, each dropped to 9.7 tok/s.

local-llmmac-mini+5
pitfallsOct 5, 20267 min
84

Published by Magic Tools