画面上にピクセルを表示するには、主に四つのハードウェアが必要です。 非常に簡単に説明すると、CPU が表示リストを計算し、GPU が画像を描写して画面に表示し、メモリが画像とデータを保持し、バッテリーが電源を供給します。 これらのハードウェアにはそれぞれ制約があります;これらの制約に抵触したり超過したりすると、アプリが遅くなったり、表示性能が落ちたり、バッテリーが消耗したりします。
特定のパフォーマンス問題の原因を突き止めるには、アプリの内部を調査し、、ツールを使ってアプリ実行動作に関するデータを収集し、データを一覧やグラフィックにして表示し、その表示内容を理解して分析し、コードを改善する必要があります。
Android Studio とあなたの端末には、アプリのレンダリング、計算、メモリー、バッテリーに関するパフォーマンスを記録して可視化するためのプロファイリングツールが用意されています。
メモ: アプリのプロファイリング中は、Instant Runを無効にする必要があります。Instant Runを使用する時は、わずかにパフォーマンスに影響があり、メソッドを更新する時にはそれより少し大きい影響があります。 このパフォーマンスへの影響が、パフォーマンスプロファイリングツールによって取得される情報へ干渉する可能性があります。 さらに、この機能を使用している間に生成されるスタブメソッドによってスタックトレースが複雑になる可能性もあります。
Performance Profiling ToolsPutting pixels on the screen involves four primary pieces of hardware. To greatly simplify, the CPU computes display lists, the GPU renders images to the display, the memory stores images and data, and the battery provides electrical power. Each of these pieces of hardware has constraints; pushing or exceeding those constraints causes your app to be slow, have bad display performance, or exhaust the battery. To discover what causes your specific performance problems, you need to take a look under the hood, use tools to collect data about your app execution behavior, surface that data as lists and graphics, understand and analyze what you see, and improve your code. Android Studio and your device provide profiling tools to record and visualize the rendering, compute, memory, and battery performance of your app. Note: While profiling an app, you should disable Instant Run. There is a small performance impact when using Instant Run and a slightly larger impact when updating methods. This performance impact could interfere with information provided by performance profiling tools. Additionally, the stub methods generated while using the feature can complicate stack traces. |
注意事項
|