Profiling with VTune

Firefox supports integration with the Intel VTune profiler. This has the advantage of capturing performance profiles that interleave native browser C/C++ callstacks with callstacks of JavaScript code and JIT compiled functions. Using VTune requires an Intel CPU. Also, VTune is able to profile across multiple threads and processes.


In order to profile, you should build Firefox manually from source, with the following Firefox build options applied:


Other custom build steps are not needed.


Using VTune is very straightforward. Launch Intel VTune Amplifier XE, create a new project, and point it to the firefox executable. It is best to start instrumentation in paused mode, first navigate to the page in question, and then resume the VTune profiling, so that the profiling run can focus its samples on the execution of the page itself. Be sure to disable any debuggers like firebug you might have, or other profilers in Firefox such as geckoprofiler.xpi while doing the run to avoid overhead from internal Firefox profilers, as VTune is a non-intrusive standalone tool. On Windows it is best to run VTune in Administrator mode, which enables additional instrumentation features.