Project ideas from Hacker News discussions.

How to speed up the Rust compiler in September 2026

📝 Discussion Summary (Click to expand)

Three prevalent themes in the discussion

Theme Summary Representative quote
1. Why Rust compiles slowly The consensus points to Rust’s rich static guarantees—especially monomorphization of generics, complex trait resolution, and the borrow checker—as the main sources of extra IR work that LLVM (or another backend) must process. “Rust just generates a ton of IR for LLVM to chew on (because of monomorphization), then LLVM takes a while to process all of it.” – kibwen
“rust compilation is slower because the compiler is doing way more things compared to C (monomorphization, complex trait resolution + type inference, borrow checker..)” – thevinter*
2. How compile times can be improved Contributors highlight algorithmic changes, incremental/caching techniques, alternative backends, and crate‑level strategies (splitting crates, earlier metadata emission, macro idempotence) as effective ways to cut wall‑time. “Going from ~1.5M to ~90K apply_effects_in_block calls by changing the CFG traversal is a reminder that the biggest compiler optimizations often come from changing the algorithm, not optimizing the hot loop itself.” – Citrusoff
“If they [macros] are [treated as idempotent] then incr comp can be faster by not evaluating them unnecessarily.” – estebank
“Emit the meta data about function types earlier for downstream slots to use… Something like 40% wall time speed up” – knuckleheads
3. Trade‑offs and priorities Many note that slower compile times are the price for Rust’s safety and performance guarantees; some argue compile time isn’t the only productivity factor, while others still want faster builds for rapid iteration. “If you want something like Rust that offers guarantees and checks … it adds up.” – jerf
“Rust can't be Go in terms of compile times if it wants to offer the guarantees and options it does.” – ModernMech
“Compile times are rarely the bottleneck for me, but that doesn't mean I won't welcome any improvements on that front.” – estebank

🚀 Project Ideas

AgentCache

Summary

  • A shared compilation cache service that extends sccache with fine-grained crate metadata tracking and worktree awareness, allowing multiple Rust agents or CI workers to reuse compiled artifacts without redundant rebuilds.
  • Core value proposition: dramatically reduces compile times for parallel agent workflows and large monorepos by caching not just object files but also metadata needed for incremental recompilation.

Details

Key Value
Target Audience Rust teams using AI agents, CI pipelines, or monorepo development with frequent parallel builds
Core Feature Centralized cache server with content-addressable storage, crate-level invalidation, and worktree‑aware keys; client library that hooks into rustc via sccache wrapper
Tech Stack Rust (actix-web or warp for server), sled or RocksDB for storage, sccache‑compatible client, optional gRPC API
Difficulty Medium
Monetization Revenue-ready: SaaS tiered pricing (free for OSS, paid for private teams with higher throughput and private storage)

Notes

  • HN commenters complained about agents filling disk and needing to cap workers: "I had to cap the fleet to 5 workers and build a dedicated resource monitor..." (s08148692). AgentCache would let them scale workers without recompiling same deps.
  • Could spark discussion on distributed build caches and inspire open‑source self‑hosted alternative.

Cargo-Split

Summary

  • A Cargo plugin that analyzes a crate’s dependency graph, change frequency (via git history), and public API surface to automatically suggest or generate a workspace split into smaller, more independently compilable crates.
  • Core value proposition: reduces incremental compile scope by isolating hot‑changing code into its own crate, letting developers reap the benefits of manual crate splitting without the overhead of manual refactoring.

Details

Key Value
Target Audience Rust developers working on medium‑to‑large crates who experience long rebuild times after small changes
Core Feature CLI that outputs a proposed workspace layout (new crates, moved modules, updated Cargo.toml) and can optionally apply the split via a safe migration script
Tech Stack Rust (uses cargo metadata, git2‑rs, heuristics), optional WASM GUI for visualizing splits
Difficulty Medium
Monetization Hobby (open‑source) – could later offer paid premium visualizer or CI integration

Notes

  • Commenters noted splitting crates helped: "Biggest win for me was splitting one fat crate into three, parallelism got real." (hnp9j9qtda). Cargo‑Split automates this win.
  • Would enable discussion on optimal granularity and provide concrete tool for the community.

MacroCache

Summary

  • A rustc plugin that detects proc‑macro idempotency (via attribute #[macro_cacheable]) and caches macro expansion results keyed by input token stream, skipping re‑execution when inputs unchanged.
  • Core value proposition: cuts down macro‑driven recompilation overhead, a major pain point highlighted by users frustrated with serde_derive and similar macros.

Details

Key Value
Target Audience Rust crate authors who rely heavily on proc‑macros (serde, derive, binding generators) and suffer from slow incremental builds
Core Feature Attribute macro + compile‑time plugin that stores macro outputs in a local cache (sccache‑compatible) and invalidates only when macro crate or its dependencies change
Tech Stack Rust (rustc plugin interface), optionally uses sccache for storage, procedural macro crate
Difficulty High (requires rustc plugin expertise)
Monetization Hobby (research‑oriented); could be sponsored by companies needing faster builds

Notes

  • Users complained about macro costs: "serde derives?" (nicoburns) and "macro expansion... repeated serde derives?" MacroCache directly addresses that.
  • Could lead to discussion about making macros idempotent by default and influencing future Rust language design.

Read Later