ツール
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
パフォーマンスの問題がどこにあるのか、どのコードから最適化を開始すればよいのかを把握するのが難しいことがあります。まずはツールを使って、問題のある箇所を絞り込んでみましょう。
Layout Inspector
Layout Inspector を使用してレイアウトを検査し、再コンポーズ数を確認できます。
UI のパフォーマンスが低い場合、コーディング エラーが原因で UI が過度に再コンポーズされることがよくあります。一方、なんらかのコーディング エラーがあると、UI の再コンポーズが必要になったときに再コンポーズを行うことができず、UI の変更が画面に表示されません。再コンポーズをトラッキングすることで、この両方の問題を見つけることができます。
再コンポーズ自体が悪いわけではありませんが、予期しない再コンポーズは問題になる可能性があります。
詳しくは、Layout Inspector の再コンポーズ数のドキュメントをご覧ください。
コンポジションのトレース
コンポジション トレースを使用して、システム トレース内のコンポーズ可能な関数をトレースします。多くの場合、トレースはパフォーマンスの問題を初めて調査するときに最適な情報源です。これによって、何が問題であり、どこから調べ始めるべきかについて、仮説を立てることができます。
参考情報
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-30 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-30 UTC。"],[],[],null,["# Tooling\n\nIt can be hard to know where a performance issue lies and what code to start\noptimizing. Start by using tools to help narrow down where your issue is.\n\nLayout Inspector\n----------------\n\nUse the [Layout Inspector](/develop/ui/compose/tooling/debug#layout_inspector) to inspect your layout and see recomposition\ncounts.\n\nIf your UI has poor performance, this is often because of a coding error that\nforces your UI to be recomposed excessively. On the other hand, some coding\nerrors can prevent your UI from being recomposed when it needs to be, which\nmeans UI changes aren't showing up on the screen. Tracking recompositions can\nhelp find both of these kinds of problems.\n\nRecomposition in itself is not bad; however, unexpected recomposition can be an\nissue.\n\nFor more information, see the Layout Inspector [recomposition counts](/develop/ui/compose/tooling/debug#recomposition-counts)\ndocumentation.\n\nComposition tracing\n-------------------\n\nUse [composition tracing](/develop/ui/compose/tooling/tracing) to trace your composable functions in a system\ntrace. Traces are often the best source of information when first looking into a\nperformance issue. They allow you to form a hypothesis of what the issue is and\nwhere to start looking.\n\nAdditional Resources\n--------------------\n\n- **[App performance guide](/topic/performance/overview)**: Discover best practices, libraries, and tools to improve performance on Android.\n- **[Inspect Performance](/topic/performance/inspecting-overview):** Inspect app performance.\n- **[Benchmarking](/topic/performance/benchmarking/benchmarking-overview):** Benchmark app performance.\n- **[App startup](/topic/performance/appstartup/analysis-optimization):** Optimize app startup.\n- **[Baseline profiles](/baseline-profiles):** Understand baseline profiles."]]