Member-only story
Jetpack Compose Internals: The Slot Table, Snapshot System, & Recomposition Mechanics
Not a Medium Member? “Read For Free”
TL;DR: The Core Mechanics
- No Virtual DOM: Compose bypasses tree-diffing entirely. It uses a Slot Table — a linear, positionally indexed runtime structure backed by a positional ledger.
- The State Engine: The Snapshot System acts like an MVCC database, isolating state reads/writes and notifying the Recomposer when tracked reads are invalidated.
- Smart Skipping: If inputs match and are compiler-verified as Stable, Compose skips the block. Skipping isn’t completely free; the
Composerstill validates metadata and advances its slot pointer. - Targeted Blast Radius: Recomposition boundaries (Restart Groups) use anchors to resume traversal exactly where an invalidation occurred, sparing the rest of the layout tree.
1. The Slot Table: A Linear, Positionally Indexed Structure
A common misconception is that Compose works like React’s Virtual DOM by generating a secondary UI tree and diffing it against the old one. Instead, Compose relies on a single, flat, linear data structure called the Slot Table.










