Systers Community
Inspect CPU Activity with CPU Profiler
Minimizing your app’s CPU usage has many advantages—such as providing a faster and smoother user experience, and preserving device battery life. It also helps your app perform well on a variety of newer and older devices.
Prerequisite:
- Setup Powerup Android using the instructions given here.
Steps:
- To open the CPU Profiler, follow these steps:
- Click View > Tool Windows > Android Profiler.
- Select the device and app process you want to profile from the Android Profiler toolbar. If you've connected a device over USB but don't see it listed, ensure that you have enabled USB debugging.
- Click anywhere in the CPU timeline to open the CPU Profiler.
- Record and inspect method traces
- To start recording a method trace, select either the Sampled or Instrumented recording configuration, or a custom recording configuration you’ve created, from the dropdown menu and click Record .
- Interact with your app and click Stop recording when you’re done. The profiler automatically selects the recorded time frame and displays its tracing information in the method trace pane.
- If you want to inspect the method trace for a different thread, just select it from the thread activity timeline.
Resources
- Article on CPU Profiler
- Ask any questions in #powerup on Systers Open source Slack.
Work Submission:
- Record atleast 2 method traces for different configurations and submit them.
- Write a blog documenting CPU performance for various interactions with the app.
Task tags
Students who completed this task
Fidella, Valentun