Last Comment Bug 740946 - Port Firefox's profiler to Thunderbird
: Port Firefox's profiler to Thunderbird
Status: RESOLVED FIXED
[leave open]
:
Product: Thunderbird
Classification: Client Software
Component: Installer (show other bugs)
: Trunk
: x86 All
: -- normal (vote)
: Thunderbird 16.0
Assigned To: Mike Conley (:mconley) - (Away until June 29th)
:
Mentors:
Depends on:
Blocks: 1106414
  Show dependency treegraph
 
Reported: 2012-03-30 13:28 PDT by Mike Conley (:mconley) - (Away until June 29th)
Modified: 2015-01-28 06:14 PST (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Add profiler.xpt to package-manifest [checked-in] (662 bytes, patch)
2012-06-13 12:44 PDT, Mike Conley (:mconley) - (Away until June 29th)
standard8: review+
Details | Diff | Review
The profiler in action in TB (176.00 KB, image/png)
2012-06-13 13:31 PDT, Mike Conley (:mconley) - (Away until June 29th)
no flags Details
Early iteration of the add-on (369.99 KB, application/x-xpinstall)
2012-06-13 13:40 PDT, Mike Conley (:mconley) - (Away until June 29th)
no flags Details

Description Mike Conley (:mconley) - (Away until June 29th) 2012-03-30 13:28:42 PDT
Benoit Gerard and a few other folks have been working on a kick-butt profiler for Gecko apps to diagnose UI jank / stickiness.

If we're serious about improving TB responsiveness, we might want to consider integrating this work.

The work is split into several parts:

1)  We need to include profiler.xpt in our package-manifest.in in order to get Thunderbird to start spewing profiling goodness
2)  For bonus points, we'd need to submit patches to the Profiler add-on to make getting profile dumps easy.  The Github repo for the add-on is at https://github.com/bgirard/Gecko-Profiler-Addon
3)  We could inject some new probe points that are TB specific

Thoughts?
Comment 1 Benoit Girard (:BenWa) 2012-04-01 17:23:45 PDT
Yea, that's exactly what needs to be done. Step 1 is trivial and step 3 is optional.

The real work is in Step 2. The profiler add-on used the Add-on SDK and the modules (tab, panel) are not compatible. We either need to port these modules or write a simple button/hotkey at a minimum to trigger a profile dump.
Comment 2 Benoit Girard (:BenWa) 2012-05-09 08:51:34 PDT
We're adding support for the remote debugging protocol. I imagine that Thunderbird will also support it. If that's the case then we wouldn't need thunderbird to run an extension and it could be controlled from Firefox like Fennec.
Comment 3 Mike Conley (:mconley) - (Away until June 29th) 2012-06-13 12:44:43 PDT
Created attachment 632819 [details] [diff] [review]
Add profiler.xpt to package-manifest [checked-in]
Comment 4 Mike Conley (:mconley) - (Away until June 29th) 2012-06-13 13:31:28 PDT
Created attachment 632847 [details]
The profiler in action in TB

I actually made some decent progress on this today - check out the pretty picture.
Comment 5 Mike Conley (:mconley) - (Away until June 29th) 2012-06-13 13:40:04 PDT
Created attachment 632850 [details]
Early iteration of the add-on

Here's a super early iteration of the add-on. It'll only be useful on a TB built with attachment 632819 [details] [diff] [review].

The add-on adds an item to the statusbar. Clicking on it will (eventually) open a content tab to the parser web app.

I say eventually, because there's a processing phase where the add-on prepares the profile, and for now, there's absolutely zero user-feedback that this is happening. So you just kinda have to trust that it'll open. I hope to fix that soon.

A few caveats:

* Stackwalking seems to be unstable in Linux, so it's currently disabled. Seems to work alright on Windows / OSX
* The add-on does not tear itself down correctly, so repeated enable/disable in the same session will populate your status bar with a ton of those "Dump Profile" items.
* The profiler cannot be enabled / disabled yet. It simply runs from the point where the add-on is enabled until shutdown.
Comment 6 Benoit Girard (:BenWa) 2012-06-13 13:50:31 PDT
(In reply to Mike Conley (:mconley) from comment #5)
> Here's a super early iteration of the add-on. It'll only be useful on a TB
> built with attachment 632819 [details] [diff] [review].

I vote that we just land that now. I don't see why we would wait.
Comment 7 Mike Conley (:mconley) - (Away until June 29th) 2012-06-13 13:59:57 PDT
Comment on attachment 632819 [details] [diff] [review]
Add profiler.xpt to package-manifest [checked-in]

Benoit:

Good point.

-Mike
Comment 8 Mike Conley (:mconley) - (Away until June 29th) 2012-06-14 06:52:35 PDT
comm-central: https://hg.mozilla.org/comm-central/rev/abcc437cc1f7

Leaving open until I can get the appropriate changes to the addon merged.
Comment 9 Mike Conley (:mconley) - (Away until June 29th) 2012-06-15 11:58:47 PDT
Add-on changes merged in.

Folks, it looks like we got ourselves a profiler!

https://github.com/bgirard/Gecko-Profiler-Addon/raw/master/geckoprofiler.xpi

Instructions:

1) Install the add-on in a recent Daily. Two items should be added to your status bar - "Disabled", and "Dump Profile".
2) Click on "Disabled" to toggle the add-on to the "Enabled" mode.
3) Do things that cause performance issues.
4) Click on "Dump Profile". A content tab will open in the Cleopatra app, which you can use to drill down and see where things are slowing down.

Check out https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-in_Profiler for more details.

For bonus points, enable stackwalking on OSX and Windows by compiling with the --enable-profiling flag.
Comment 10 Mike Conley (:mconley) - (Away until June 29th) 2012-06-15 12:01:41 PDT
Also note that "Dump Profile" will not work unless the profiler is set to the "Enabled" mode.

"Dump Profile" will only show you the activity since the last time you "Enabled" it.

Note You need to log in before you can comment on or make changes to this bug.