compose-recomposition-performance
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCompose recomposition performance
Jetpack Compose重组性能
Router only — deep fixes live in and .
compose-stability-diagnosticscompose-state-deferred-reads仅作路由指引——深度修复方案请查看 和 。
compose-stability-diagnosticscompose-state-deferred-readsTwo axes
两大排查维度
- Parameter stability / skipping — can Compose skip this restartable composable; are arguments stable and comparable?
- Where is read — is frame-rate
Stateread during composition vs layout/draw?State
Either axis can dominate; they combine independently.
- 参数稳定性/可跳过性 — Compose能否跳过该可重启的composable?参数是否稳定且可比较?
- State读取阶段 — 帧率相关的State是在重组阶段读取,还是在布局/绘制阶段读取?
任一维度都可能是主要问题,二者相互独立且共同影响性能。
Route here → focused skill
路由指引 → 针对性技能
| Primary suspicion | Next skill |
|---|---|
Skipping, unstable params, compiler/ | |
Frame-rate | |
| Evidence for both | Apply both skills in parallel |
| 主要怀疑方向 | 下一步技能 |
|---|---|
可跳过性问题、参数不稳定、编译器/ | |
| 帧率State读取阶段(重组 vs 布局/绘制) | |
| 两者均有迹象 | 同时应用两项技能 |
Review order
排查步骤
- Decide which axis fits the evidence; open the matching skill.
- If unclear, sample both — stability churn vs composition-phase reads of fast .
State - Re-measure after changes.
- 根据现有迹象确定对应的排查维度,打开匹配的技能文档。
- 若无法确定,则同时排查两者——参数稳定性频繁变动与快速State在重组阶段的读取问题。
- 修改后重新测量性能。
When NOT to apply
不适用于以下场景
- Recomposition tracks real data changes, or the bug is correctness not cost.
- No profiler / compiler signal suggests a problem.
- 重组是真实数据变化导致的,或者问题属于正确性而非性能开销问题。
- 没有性能分析器或编译器信号表明存在问题。