Support different recording modes
The buttons and shortcuts for starting and stopping the profiler are confusing, especially for new users. I was chatting with a new user about this, and I think I figured out a way to make it simpler. I believe there are two workflows we should support.
Single recording mode (default)
- Browser starts up
- The profiler is off
- There is a grayed out button in the toolbar
- Hit the button
- The menu opens
- Hit "start profiling" (or Ctrl+Shift+1)
- The profiler starts
- The button goes from gray to an active blue
- Perform some actions on the page
- Hit the button (or Ctrl+Shift+1 or 2)
- no menu opens
- the button is grayed out
- the profiler pulls the data out of the buffer
- the profiler stops, clears the buffer
- perf.html is opened to view the profile
Continuous recording mode (currently implemented mode)
- Open up the add-on menu
- Click advanced
- Turn on "Continuous recording mode"
- Now and when the browser is restarted
- The profiler is on
- There is a blue button in the toolbar
- Hit the toolbar button
- A menu opens up, showing recording options with the same current UX.
- Hit the menu then "capture" (or Ctrl+Shift+2)
- the button continues to be blue
- the profiler pulls the data out of the buffer
- the profiler continues recording, leaving the buffer's contents
- perf.html is opened to view the profile
- Hit (Ctrl+Shift+1)
- Toggles the recording being on, and clears the buffer of data.
I would change the current UX in the following way to make the profiler easier to use:
- remember the previous state when restarting browser (#10)
- when one stops the profiler with ctrl-shift-1, that should not erase the recorded data. That is because a lot of people approach the profiler with the presumption that the operation steps would be 1. start, 2. stop, 3. analyze. So it would be good to allow analyzing the captured data even if the profiler has been already stopped first.
- have a check box in profiler settings: [] Stop profiling on analyze. If enabled, tapping ctrl-shift-2 when the profiler is on would stop the profiler. If disabled, then the profiler would keep on running as it currently does. This check box state would also be remembered across browser restarts. See also https://bugzilla.mozilla.org/show_bug.cgi?id=1053109 which is related to this.
I agree with 1 and 3.
2 is a problem because keeping the buffer contents around has memory implications: The compartments of any JS functions in the buffer will be kept alive until that JS function leaves the profiler buffer (or the profiler buffer is cleared).
We could make the stop button collect the profile and keep that data around, but what if you want to stop the profiler and never look at the current profile?
mstange pointed me here after I asked on IRC if there was a way to make the profiler automatically start on browser startup. I occasionally notice jank in the UI and want to grab a profile, but if I didn't remember to enable the profiler first I can't do that, and sometimes it's not a reproducible event. I'd just like to have the profiler always-on, regardless of overhead. (Additionally, on Nightly we get 2 updates per day now so I restart a lot.)
The new workflow has been implemented in Firefox with UX support, so closing this one now.