Android App Performance Analysis with Perfetto

Kayvan Kaseb
Software Development
5 min readAug 21, 2020

--

This picture is provided by Unsplash

Basically, it is extremely vital for Android applications to perform all operations as fast as possible. An Android app is considered to have poor performance if it responds slowly, shows choppy animations, freezes, crashes, or consumes a lot of power. To avoid these problematic issues, there are some best practices and tools have been introduced and developed. This essay will discuss Android app performance analysis by using Perfetto as an advanced platform-wide tracing tool.

Introduction and Overview

As a matter of fact, recording device activity over a short period of time is is called System Tracing. System tracing produces a trace file, which can be used to generate a system report. This report helps you identify how best to improve your app or game’s performance. The Android platform supports some different options for recording traces:

  1. Android Studio CPU profiler

The Android Studio CPU profiler inspects your app’s CPU usage and thread activity in real time when you want to interact with your Android app. Also, you can be able to inspect the details in recorded method traces, function traces, and system traces.

2. System Tracing app

In fact, this option is similar to the systrace command-line utility; however, the app allows you to record traces directly from a test device itself, without needing to plug in the device and connect to it over ADB. In addition, you can use the app to share your results from these traces with your development team.

Devices running Android 9 (API level 28) or higher include a system-level app called System Tracing.

3. Systrace command-line tool

Initially, Systrace is a legacy platform-provided command-line tool, which records device activity over a short period of time in a compressed text file. The tool produces a report that combines data from the Android kernel such as the CPU scheduler, disk activity, and app threads.

4. Perfetto

Perfetto is the new platform-wide tracing tool, which is introduced in Android 10. It is a more general and sophisticated open-source tracing project for Android, Linux, and Chrome. It provides a superset of data…

--

--

Kayvan Kaseb
Software Development

Senior Android Developer, Technical Writer, Researcher, Artist, Founder of PURE SOFTWARE YAZILIM LİMİTED ŞİRKETİ https://www.linkedin.com/in/kayvan-kaseb