V8's Runtime Call Stats provide precise timing information for all V8 components. This provides more granular information on where V8 spends its time than we've exposed in DevTools previously. Insights it offers includes time spent preparsing scripts, lazy compilation and so on.
This guide is a compliment to the 'Runtime Call Stats in Chrome' using about:tracing tutorial.
- Go to webpagetest.org. Expand the WebPageTest Advanced tab and go to 'Chrome'
- Check the 'Capture Dev Tools Timeline' and 'Capture Chrome Trace (about://tracing)' checkboxes
- In 'Trace Categories', replace the text with
disabled-by-default-v8.runtime_stats
- Specify your Website URL, test location and browser. At the time of writing, it will need to be Chrome Canary.
- Click 'Start Test' and wait for your results to complete.
- The very left-hand-side of your 'Test Results' will include a column with First View and (depending on your settings) Repeat View. Here you can click on
Timeline
orTrace
to download the trace file. Alternatively you can clickview
next to Trace to view Trace directly. - If you downloaded your trace, you will probably have a .json file in Downloads (or whereever you saved it).
- Fire up Chrome Canary. Open up about:tracing.
- Click 'Load' and select the .json file
- Once loaded, you can go to the search-box next to 'View Options' and type in 'runtime' or 'runtime_stats'.
- You should now see a number of V8.RuntimeStats available. W00t. They look a little like this:
The run used for the above tutorial is available on WebPageTest here: https://www.webpagetest.org/result/170112_SW_4G96/
Note: V8 also offer a callstats.py helper for more easily aggregating statistics exposed by RCS should you need something like that.