Skip to content

Instantly share code, notes, and snippets.

Last active October 20, 2020 21:00
What would you like to do?
V8 Runtime Call Stats and WebPageTest

V8 Runtime Call Stats and WebPageTest

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.

  1. Go to Expand the WebPageTest Advanced tab and go to 'Chrome'
  2. Check the 'Capture Dev Tools Timeline' and 'Capture Chrome Trace (about://tracing)' checkboxes
  3. In 'Trace Categories', replace the text with disabled-by-default-v8.runtime_stats
  4. Specify your Website URL, test location and browser. At the time of writing, it will need to be Chrome Canary.
  5. Click 'Start Test' and wait for your results to complete.
  6. 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 or Trace to download the trace file. Alternatively you can click view next to Trace to view Trace directly.
  7. If you downloaded your trace, you will probably have a .json file in Downloads (or whereever you saved it).
  8. Fire up Chrome Canary. Open up about:tracing.
  9. Click 'Load' and select the .json file
  10. Once loaded, you can go to the search-box next to 'View Options' and type in 'runtime' or 'runtime_stats'.
  11. You should now see a number of V8.RuntimeStats available. W00t. They look a little like this:

screen shot 2017-01-12 at 9 51 49 am

The run used for the above tutorial is available on WebPageTest here:

Note: V8 also offer a helper for more easily aggregating statistics exposed by RCS should you need something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment