Setting up the Gecko Profiler extension
- Download and install the latest version of the Gecko Profiler extension
- The profiler extension will show up in the top right of the URL bar as a globe icon (if not, drag it there from the Customize window).
- Remember to disable or uninstall the extension if you're not using it.
macOS only, or to check whether a problem has been fixed in a later Firefox version (macOS release builds will currently produce profiles missing some important information):
- Download and start the nightly build for your platform. You will have to close all running instance(s) of Firefox before launching nightly.
- Nightly is a development version, which may contain bugs, so test with a new profile or back up your data.
- Verify that it is running correctly by going to 'About Nightly' by looking for 'nightly' as the update channel (3rd line). The icon should be a blue globe.
Using the Add-on
Once installed, the profiler becomes active immediately (the icon being blue indicates it is active). The profiler uses a fixed size buffer to store sample data. When it runs out of space in its buffer, it discards old entries so you may want to increase the buffer size if you find you are unable to capture the profile quickly enough after you notice a performance problem. In the Settings part of the UI you can adjust the size of the buffer (presently defaults to 9 MB) and the time interval between data collection (presently defaults to 1 ms). Note that increasing the buffer size uses more memory and can make capturing a profile take longer.
Using the keyboard shortcuts is often more convenient than using the mouse to interact with the UI:
Ctrl+Shift+1- Start/Stop the profiler
Ctrl+Shift+2- Take a profile and launch Cleopatra to view it
Capturing and sharing a profile
- Reproduce the performance problem. If possible let the problem manifest itself for 5-10 seconds.
Ctrl+Shift+2or click on the 'Globe' icon in the top right and select 'Capture Profile'. Try to do this within a few seconds from reproducing the performance problem as only the last few seconds are recorded. If the timeline has a large red block it's a good sign.
- The data will open in a new tab. Wait until the "Waiting for symbol tables for library libxul.pdb..." notification disappears before sharing the profile.
- There will be a button in the top right labeled 'Share' which will upload this profile and once completed will write out a link. Copy this URL to your clipboard by right clicking and add the profile URL to a bug for your performance problem and/or send it to the appropriate person. Try to give some context about what you were doing when the performance problem arose such as the URL you were viewing and what actions were you doing (ex. scrolling on gmail.com).
Viewing addon performance in GeckoView
Sometimes an addon or more are slowing down Firefox. These addons might be using the extension API in ways that were not meant to. You can see which of these addons are causing problems by adding the "moz-extension" filter.
Make sure you are selecting the process that is using up the CPU since all of the processes are shown. You might have a content process using up the CPU and not the main one.
Your first reflex once you find what addon is slowing down the profile might be to disable it and search for alternatives. Before you do this, please share the performance profile with the addon authors through a bug report. Gecko profiler allows you to share a link with the profile.