Profiling
Contents
Profiling Firefox
There is a collection of methods for profiling Mozilla listed on the performance tools page.
This old article links to some recommended methods for profiling under different systems, including JProf, which can be used to capture and accumulate snapshots of stack traces.
If you wish to help to test Firefox performance, you may be interested in The Mozilla QA Project.
Firefox is now built using Profile Guided Optimization (PGO), a feature provided by gcc which optimizes the compiled binary by examining profiles taken during previous runs.
Profiling the build process
The process of compiling Firefox can take a long time to complete. ccache and distcc can help with this.
Profiling XUL, Javascript and HTML
You may want to profile the speed of scripts running inside Firefox.
The Firebug extension offers various profiling options.
YSlow is an extension which attaches to Firebug and can recommend improvements to make the pages on a website run faster. It detects inefficiencies in the webserver and delivered pages, rather than inefficiencies in Firefox.
The Jiffy extension displays detailed Javascript timing information in the browser. (Its library Jiffy-Web can send user profiling data back to the webserver.)
The XUL Profiler extension was written to track down which parts of the rendering are taking the most time.
Greasemonkey script writers can profile Greasemonkey scripts using Firebug.
Specific Cases
I notice Firefox is sometimes taking CPU when I am not using it. I would like to find out what Firefox is doing at these times. Logging the calls being made by running threads would be useful. Currently I am testing if XUL Profiler can track threads running outside of the page. Well it was certainly able to show me some inefficiencies in javascript. But I don't think it's tracking everything which Firefox is doing, because sometimes there is high CPU usage, but nothing significant logged by XUL Profiler. I think to trace everything, I must rebuild Firefox. --JoeyTwiddle