Firefox Built-in Profiler

Warning: Some users have having trouble with these instruction. Please see the comments. If you’re adventurous please report any difference so that I can adjust these steps.

Profiling and collecting data right now is a pain. Each platform as its own set of tools that are often never at hand when you notice something going slowly. Or you noticed a short lived hang that you can’t really reproduce once you attach your profiler.

Built-in profiler to the rescue. By having a profiler built in we get many benefits. We can build a profiler that works across platform, that is always on, that grabs markers for important events (page load start, new tab open, first paint), that can be started/stopped programmatically, that can integrated with the UI using extensions and inlines the JS stack.

I made a 5 min demonstration of this profiler in action:

Quicktime version: Profiler Screencast 420p.

This is a proof of concept at this stage. It currently only works well on Mac and somewhat on Android but with a bit of work it should work well on all platforms we support. Further down the road we’re hoping to move the front end to a web application that we can easily collect profiles and link them within bugzilla.

We’re looking for help porting this to windows and linux, hooking in libunwind and working on the web front end. If you’re interested in helping out let us known.

7 thoughts on “Firefox Built-in Profiler

  1. Please, pretty please, with sugar on top, could you avoid adding one more way to unwind stack? Breakpad has one, jprof has one, the refcount logger has one, and ther are probably some more hidden in the code base.

    Pick one, centralize it, improve it, and stick it in libmozutils. Please.

  2. I have converted the video to WebM (vp8) encoding so it is easier to view in Firefox. Here is a link to the video:

    [video src="" /]

    Thanks Benoit!

  3. Pingback: Taras’ Blog » Blog Archive » Introducing Project Snappy

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s