google/perfetto

Developer Tools

Trace and profile Android, Chromium and native C++ systems, then query multi-GB traces with SQL in a local browser UI.

6,711
917
C++
Apache-2.0
6 years old

Perfetto is worth trying if you need to answer "why is this slow?" across process boundaries, not just inside one function. It is a tracing system first, and a viewer second.

The problem

A slow Android startup or dropped frame usually involves your app, the framework, the scheduler and the kernel at once. Local stopwatches or a single-process profiler show only one slice of that timeline, so correlating a stall with a thread wake-up or a memory event means stitching together separate outputs by hand. Perfetto instead captures many processes and OS-level probes into one unified trace file, then lets you inspect that shared timeline. The result is a single artifact where app trace points, scheduling states and CPU counters line up on the same clock.

What's different

The mechanism is a set of cooperating pieces rather than one binary: tracing daemons that aggregate many processes, a C++17 SDK for userspace-to-userspace trace points, OS probes for scheduling, CPU frequency, memory and callstacks, a browser UI, and a SQL engine over the trace. The practical payoff is that analysis becomes programmatic: once a trace is loaded, you write SQL to compute custom metrics instead of clicking through a timeline. The UI opens traces from other tools too, including Linux perf, macOS Instruments and Chrome JSON traces, so it can serve as a common viewer even when capture came from elsewhere. The trade-off is conceptual weight. Perfetto expects you to understand tracing as a discipline, and the README points newcomers to a dedicated introduction before the getting-started path makes sense. It is explicitly a suite, and picking the right component for a given problem is part of the work.

Who should try it

Good fit: an Android app or platform developer chasing slow startups, jank, animation glitches, low-memory kills or ANRs; a Linux kernel developer who wants an ftrace front end with a timeline; a C/C++ developer on Linux, macOS or Windows who wants to instrument their own code. Poor fit: someone who wants a drop-in profiler for a single function or a one-click flame graph with no setup, since the value here comes from correlating system-wide events. If you only need to open an existing Chrome or perf trace for a quick look, the UI is the lightest part of the stack and you can ignore most of the rest.

Requirements and limitations

Tracing daemons and OS probes are strongest on Android and Linux, so the deep system-wide view depends on the platform you target; the C++ SDK itself is documented for Linux, macOS and Windows. The UI is browser-based and fully local with no installation, which lowers the barrier for viewing. The SQL analysis layer is powerful but implies learning its schema before automated metrics pay off. The project is the default tracing system for Android and Chromium, which indicates production use in those environments but says nothing about your specific setup.

HotRepo's take

HotRepo recorded one daily-board observation: on 2026-10-28 the repository stood at 6,711 stars with +5 that day. One snapshot is not comparable daily history, so persistence of interest cannot be judged from this data. The repository dates to 2019-12-10, so age is not in question. Before adopting, check that your target platform is covered by the documented probes and SDK path, and start from the role-based getting-started guide rather than assuming the stack applies uniformly.

Project source and documentation

Written by AI from the project's README, updated October 28, 2026. The project's own docs are the source of truth.

Hacker News