Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome developer tools - Profiling results file format

I'm wondering is there any (un)official spec to .cpuprofile file format, which is generated when JavaScript profiling is used in Chromium-based browser's developer tools.

It is plain-text JSON so it is easy to get call tree data but I don't understand how to get timing information for each function.

Also I'm interested in hit count for every function.

like image 830
Olegas Avatar asked Nov 01 '22 14:11

Olegas


1 Answers

According to the documentation provided by @artm, the output can be analyzed with kcachegrind. What you need to do in order to load a Chrome .cpuprofile file into this is to convert it to callgrind format.

You don't mention your dev environment, so I can't say the best what the easiest way for you to go about this will be.

The documentation mentions Google's perf tools and kcachegrind for this. These tools need to be built manually and I don't have a convenient environment for doing that.

Here is how I went about it on a Windows 8.1 machine with Node installed.

  1. Install chrome2calltree for Node. This command utility will convert your .cpuprofile to a callgrind format.

  2. Install QCacheGrind. This is a Windows pre-built port of kcachegrind that will let you visualize your callgrind formatted file.

  3. Convert your .cpuprofile: chrome2calltree -i test.cpuprofile -o callgrind.profile

  4. Open your callgrind.profile with QCacheGrind.

like image 70
davidmdem Avatar answered Nov 09 '22 07:11

davidmdem