Google recently has official launched compose-runtime-annotation library

skydovesJaewoong Eum (skydoves)||2 min read

Google recently has official launched compose-runtime-annotation library

Google has recently launched the official runtime-annotation library, which serves a similar purpose to the community-built compose-stable-marker library.

The idea behind compose stable markers originated from the Compose runtime itself: helping the Compose compiler optimize performance by indicating which types are stable or immutable—even when used outside of Compose-dependent modules.

This library includes extracted Compose annotations such as @Stable, @Immutable, and @StableMarker. These annotations allow you to inform the Compose compiler that your class or property produces immutable instances, improving recomposition performance. It’s particularly useful in multi-module projects where you want to avoid adding a hard dependency on compose-runtime—especially in pure Kotlin or non-UI modules.

This article continues for subscribers

Subscribe to Dove Letter for full access to 40+ deep-dive articles about Android and Kotlin development.

Become a Sponsor