r/JetpackComposeDev • u/Realistic-Cup-7954 • Oct 19 '25
Tips & Tricks Understanding SlotTable in Jetpack Compose
SlotTable is the internal structure that makes Compose recomposition fast.
It stores your UI as a compact tree inside two flat arrays.
What it is
groups: structure and metadataslots: actual data and objects A single writer edits it efficiently using a gap buffer. Readers always see a clean, stable snapshot.
Core ideas
Each group represents a node and its subtree
Anchors act as bookmarks that survive inserts and deletes
Writers move a gap to update parts of the tree in place
Readers use simple linear scans
Why it matters
Enables fast, partial UI updates instead of full rebuilds
Keeps stable identities through anchors and keys
Powers features like Live Edit and accurate inspection tools
Mental model
Groups define structure. Slots hold data. One writer moves a gap to edit. Readers see a stable version. Anchors keep your place when things shift.
What’s your mental model for how Compose remembers UI state?
Credit : View Akshay Nandwana’s








