Profiling Chromium and Blink
There are a few ways to profile Chromium and Blink. Here are some of the tools that work well for diagnosing performance problems.
See also the Deep memory profiler.
Built-In Tools
For JavaScript issues, the built in profiler works very well. To use this open up the Chrome Dev Tools (right click, Inspect Element) and select the 'Profiles' tab.
For a broader understanding of Chromium speed and bottlenecks, as well as
understanding how posted-task and threads interact in aggregate, there is a
cross-platform, task-level profiler built in. Profiler results can be seen in
about:profiler (or equivalently chrome://profiler) For more details, visit
(https://www.chromium.org/
See chrome://tracing for timelines showing TRACE_EVENT activity across all the different threads; originally used for GPU performance, and will probably require you to add TRACE_EVENT calls to the features you're interested in outside of compositing & rendering (this was named about://gpu through M14).
C++
For native C++ code the tools depend on the OS.
Note that basic printf debugging and using a general debugger (such as gdb) may be sufficient for some purposes. However, more specialized tools are available.
Linux, ChromeOS, Android
See https://chromium.googlesource.com/
OS X
DTrace and the pre-packaged "CPU Sampler" tool in Xcode work well. Shark or the command-line sample work also, though they both will spend an exceedingly long time processing symbols if you are running Leopard (10.5). Anecdotally this is much faster in Snow Leopard (10.6)
Windows
Windows Performance Toolkit (WPT, aka xperf, ETW, or WPA) is a free profiler
from Microsoft that can profile CPU consumption, CPU idle time, file I/
Visual Studio also includes an instrumenting profiler. "vsinstr /help" and "vsperfcmd /help" have details for additional options. Currently this requires a non-debug non-component build of Chromium (debug or component builds omit the /profile linker flag).
AMD Code Analyst is a free profiler that can run inside Visual Studio. It captures frequency counts for functions in every process on the computer. It can optionally capture call-stack information, %CPU, and memory usage statistics; even with the Frame Pointer Omission optimization turned off (build\internal\release_defaults.gypi; under 'VCCLCompilerTool' set 'OmitFramePointers':'false'?), the call stack capture can have lots of bad information, but at least the most-frequent-caller seems accurate in practice.
Intel's VTune 9.1 does work in the Sampling mode (using the hardware performance
counters), but call graphs are unavailable in Windows 7/
Very Sleepy (http://www.codersnotes.com/
Android
See Profiling Content Shell on
Android
for detailed Android-specific instructions, and Telemetry
profiling for general instructions about using
Telemetry to profile (rather than using adb_profile_chrome).
GPU profiling
Both nVidia PerfHUD and Microsoft PIX are freely available. They may not run without making minor changes to how the graphics contexts are set up; check with the chrome-gpu team for current details.
The OpenGL Profiler for OSX allows real-time inspection of the top GL
performance bottlenecks, as well as call traces. In order to use it with
Chrome/
GPUView is a Windows tool that utilizes ETW (Event Tracing for Windows) for
visualizing low-level GPU, driver and kernel interactions in a time-based
viewer. It's available as part of the Microsoft Windows Performance Toolkit, in
%ProgramFiles%\Windows Kits\10\Windows Performance Toolkit\GPUView. There's
a README.TXT in there with basic instructions, or see
http://graphics.stanford.edu/
Googlers Only
Take a look at go/