Google Chrome developer tools - Profiling results file format Google Chrome developer tools - Profiling results file format google-chrome google-chrome

Google Chrome developer tools - Profiling results file format


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.


This might not be a direct answer to your question , but this is really awesome.

usage is very simple:

fireunit.profile(function(){  document.getElementsByClassName("foo");});

You’ll get the following JavaScript object returned from fireunit.getProfile():

{  "time": 8.443,  "calls": 611,  "data":[  {    "name":"makeArray()",    "calls":1,    "percent":23.58,    "ownTime":1.991,    "time":1.991,    "avgTime":1.991,    "minTime":1.991,    "maxTime":1.991,    "fileName":"jquery.js (line 2059)"  },  // etc.]}


Maybe it is notable but the JSON format of cpuprofile probably has changed recently, so it may not be a stable format. In Chromium 44 for example (older version from their build archives) it looked like this

jq keys < chromium_44.cpuprofile[  "endTime",  "head",  "samples",  "startTime",  "timestamps"]

In latest chrome 55 it is

jq keys < chrome_55.cpuprofile[  "endTime",  "nodes",  "samples",  "startTime",  "timeDeltas"]

Just something to be wary of. I have not seen much if any documentation on the format though