Skip to content
Opensource internals
  • Posts

Rust

The Lock That Disappears: How rustc Deletes Every Atomic From a Single-Threaded Build

Oct 21, 2026 5 min read Jay Hubbert

rustc picks its locking strategy at compile time from the thread count, so a single-threaded build pays zero atomics for every cache shard and every mutex.

RustInternalsCompilerPerformanceConcurrency

Read more →

Four Shapes of Cache: How rustc Picks the Right Data Structure for Each Query

Oct 21, 2026 6 min read Jay Hubbert

rustc’s query caches come in four shapes, selected per query key type: a OnceLock for unit keys, a bucketed VecCache with an atomic index-and-lock word, a local/foreign hybrid, and …

RustInternalsCompilerPerformanceData structures

Read more →

Green Means Same: How rustc Re-runs Every Query and Then Throws Most of the Work Away

Oct 21, 2026 7 min read Jay Hubbert

Incremental compilation in rustc re-runs queries and compares fingerprints; the interesting parts are the reversible fingerprints, the no_hash escape hatch and the probabilistic …

RustInternalsCompilerIncrementalPerformance

Read more →

One u32, Three Colors: How rustc Packs Its Dependency Graph State Into Four Bytes

Oct 21, 2026 6 min read Jay Hubbert

The color map of rustc’s incremental compiler encodes green, red and unknown in one u32, and hides the current-session index inside the green case.

RustInternalsCompilerIncrementalPerformance

Read more →

← Newer Page 8 of 8 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·