Introduction The is first of all good because it is integrated into and is designed specifically for profiling Android applications. However, it has a number of disadvantages, which you can find on or : hangs, crashes, incorrect data (over- or underestimated time), not always attached to the process. Android Profiler Android Studio StackOverFlow Issue Tracker https://issuetracker.google.com/issues/110924477?pli=1?embedable=true https://stackoverflow.com/questions/55552916/android-profiler-stuck-in-loading?embedable=true This is especially noticeable on large commercial projects (small projects usually have no problems). In such cases, it is recommended to use . Perfetto It is worth noting that also has disadvantages, but works more stably. Its disadvantages are mainly related to the inconvenience of work. knows how to work not only with Android applications. It integrates with , so it can trace , as well as . Perfetto Perfetto ftrace Linux Android Linux Chromium Related to this is another advantage of - it sees the whole picture, not just the Android app. This means that if another process has affected the application process, you can see it through Perfetto. This is not available to . Perfetto Profiler Another downside to is that it is only available with . And it needs to be activated. With it is enabled by default. To activate it, you need to enter: Perfetto Android 9 (P, api 28) Android 11 (R, api 30) adb shell setprop persist.traced.enable 1 Working with Perfetto There are several ways of working with . Let's look at one of the most obvious ones. Perfetto Let's take as an example. Create a project and insert the following code: PerfettoActivity class PerfettoActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Trace.beginSection("Perf: printString") Thread.sleep(2000) Trace.endSection() } } The point of this example is that we delay the thread by 2000ms and wrap it in a and section. With these methods it will be easier for us to find in the renderer. main Trace.beginSection() Trace.endSection() Next, go to Device Settings -> System -> Advanced -> Developer options -> System Tracing It is necessary to enable the option. When this option is checked, the button in the quick settings becomes available. Show Quick Settings tile Record trace Next, go to Quick settings, click , launch the application and click . A file at will appear in the device memory. In order to retrieve it, you must enter the command: Record trace Stop tracing data/misc adb pull /data/local/traces After that, the folder will appear in the root of the project, where the necessary file will be located: traces Then go to: . https://ui.perfetto.dev/ There is a visualizer available at for easy viewing and analysis of the results. The new visualizer takes advantage of modern Web platform technologies. Its multi-threaded design, based on , provides a consistently responsive user interface. You can read more about it . ui.perfetto.dev WebWorkers here user interface, once opened once, works completely offline. Traces opened with the UI are handled locally by the browser and require no server-side interaction. The Perfetto In the panel on the left, click the button. Find the file just generated by Android Studio and click . Open trace file .perfetto-trace Open The following result appears: The picture shows all the processes and threads that take place on the device. The colored bars show the methods running in these threads. Let's find the process of our application in the list. In my case it is (see point 1). com.leonidivankin.draftandroid Here we find the thread (point 2). As you see, its name is not main. In this line you can see the methods executed when creating and starting the activation (point 3). main They also have different names, in particular you can find the - this is the method in Android concepts. As I see it, this is the main drawback of before - the inconsistency of thread and method names relative to the source code. performCreate:com.leonidivankin.draftandroid.articles.perfetto.PerfettoActivity onCreate() Perfetto Profiler Here we see our section marked with the tag (point 4). Click on this section and a window opens with additional information : Perf: printString Current Selection Here you can see additional information about the work done in the section (point 2), in particular the time of completion (point 3). You can also use the search bar (point 1) and enter there the tag you are looking for. The visualizer highlights the desired process (point 2), thread (point 3), and segment (point 4). Perf: printString Perfetto Using control+scroll, you can zoom in and out: Scroll down and up through the panel. You may notice processes you are familiar with, such as , and others: Perfetto bluetooth, audio.service, composer, systemui This way you can establish dependencies between your application and others and look for problems in their dependencies. From my point of view, this is the most important advantage of over . Perfetto Profiler Comparing Perfetto with Profiler Advantages: sees the processes of all applications; works more stably and accurately with large projects. Disadvantages: not integrated into Android Studio; only available with Android 9; inconsistency of names and threads with the source code. Useful Links https://perfetto.dev/docs/ https://ui.perfetto.dev/ https://github.com/google/perfetto https://www.youtube.com/watch?v=phhLFicMacY https://www.youtube.com/watch?v=QCj-NaErICI https://www.youtube.com/watch?v=9kNhB_z704I https://medium.com/kayvan-kaseb/android-app-performance-analysis-with-perfetto-c8707d879abd Conclusion is a quite powerful tool when you need to look inside the processes running on your device. It is most often used to analyze applications and optimize, for example, the cold-warm-hot start speed of an application. It has several advantages. For example, analyzing all the processes as a whole and getting more accurate results. However, as you have seen, it is not without disadvantages. Perfetto