gecko-dev/devtools/client/performance-new
Paul Adenot 5a606e463e Bug 1626918 - Add the native audio callback thread to the profiler. r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D78503
2020-06-12 13:13:06 +00:00
..
@types Bug 1633855 - Re-work the experimental definitions for features; r=julienw 2020-05-27 22:07:08 +00:00
aboutprofiling Bug 1617246 - Always consult objdirs for symbols. r=gregtatum 2020-05-11 19:52:53 +00:00
components Bug 1633855 - Break out the about:profiling features into separate sub-sections; r=julienw 2020-05-27 22:07:30 +00:00
popup Bug 1626918 - Add the native audio callback thread to the profiler. r=gregtatum 2020-06-12 13:13:06 +00:00
store Bug 1633855 - Clean up some old getSupportedFeatures actor compatibility; r=julienw 2020-05-27 22:06:54 +00:00
test Bug 1634448 - Update the menu button to reflect the current profiler states; r=canaltinova 2020-05-26 15:59:59 +00:00
.eslintrc.js Bug 1622328 - add license info to all eslintrc files r=Standard8,webcompat-reviewers,miketaylr 2020-03-19 13:47:51 +00:00
README.md Bug 1621022 - Change the workflow of enabling the profiler menu button; r=canaltinova 2020-03-25 15:34:59 +00:00
browser.js Bug 1617246 - Always consult objdirs for symbols. r=gregtatum 2020-05-11 19:52:53 +00:00
frame-script.js Bug 1607801 - Upgrade TypeScript to v3.8.3; r=julienw 2020-04-28 17:48:53 +00:00
index.xhtml
initializer.js Bug 1607801 - Pre-define ChromeUtils.import paths; r=julienw 2020-04-28 17:49:59 +00:00
moz.build Bug 1617246 - Always consult objdirs for symbols. r=gregtatum 2020-05-11 19:52:53 +00:00
package.json Bug 1607801 - Upgrade TypeScript to v3.8.3; r=julienw 2020-04-28 17:48:53 +00:00
panel.js Bug 1611817 - Fix race condition in DevTools shutdown and stopProfilerAndDiscardProfile; r=julienw 2020-03-09 14:57:05 +00:00
preference-management.js Bug 1589122 - Add and use functions to translate values between the stored preferences and the state r=canaltinova 2019-10-22 08:13:58 +00:00
symbolication.jsm.js Bug 1617246 - Always consult objdirs for symbols. r=gregtatum 2020-05-11 19:52:53 +00:00
tsconfig.json Bug 1582779 - Offer to restart the browser when JS Tracer is enabled; r=julienw 2019-11-12 19:06:48 +00:00
typescript-lazy-load.jsm.js Bug 1607801 - Create a TypeScript friendly lazy loading mechanism; r=ochameau 2020-04-28 17:51:09 +00:00
typescript.md Bug 1606472 - Fixup some typings that were set to any; r=julienw 2019-12-31 20:53:48 +00:00
utils.js Bug 1641149 - Add 'fileio', 'fileioall', 'noiostacks' to about:profiling - r=gregtatum 2020-05-28 01:25:02 +00:00
yarn.lock Bug 1607801 - Upgrade TypeScript to v3.8.3; r=julienw 2020-04-28 17:48:53 +00:00

README.md

Performance New

This folder contains the code for the new performance panel that is a simplified recorder that works to record a performance profile, and inject it into profiler.firefox.com. This tool is not in charge of any of the analysis, only the recording.

TypeScript

This project contains TypeScript types in JSDoc comments. To run the type checker point your terminal to this directory, and run yarn install, then yarn test. In addition type hints should work if your editor is configured to speak TypeScript.

Overall Architecture

This project has a few different views explained below.

DevTools

This is a simplified recording panel that includes a preset dropdown. It's embedded in the DevTools. It's not the preferred way to use the profiler, but is included so that users are comfortable with existing workflows. This is built using React/Redux. The store's code is shared by all the views, but each view initializes it separately. The popup does not use React/Redux (explained later). When editing a custom preset, it takes you to "about:profiling" in a new tab.

This panel works similarly to the other DevTools panels. The devtools/client/performance-new/initializer.js is in charge of initializing the page specifically for the DevTools workflow. This script creates a PerfActor that is then used for talking to the Gecko Profiler component.

DevTools Remote

This is the same UI and codebase as the DevTools panel, but it's accessible from about:debugging for remote targets. It uses the PerfFront for a remote target to profile on the remote device. When editing a custom preset, it takes you to "about:profiling" in the same modal.

This page is initialized with the PerfActor, but it will target a remote debuggee, like an Android Phone.

about:profiling

This view uses React/Redux for the UI, and is a full page for configuring the profiler. There are no controls for recording a profile, only editing the settings. It shares the same Redux store code as DevTools (instantiated separately), but uses different React components.

about:profiling Remote

This is the remote view of the about:profiling page. It is embedded in the about:debugging profiler modal dialog, and it is initialized by about:debugging. It uses preferences that are postfixed with ".remote", so that a second set of preferences are shared for how remote profiling is configured.

Profiler Popup

The popup is enabled by default on Nightly and Dev Edition, but it's not added to the navbar. Once the profiler menu button is added to the navbar, or other places in the UI, the shortcuts for the profiler will work. In any release channel the popup can be enabled by visiting profiler.firefox.com and clicking Enable Profiler Menu Button. This flips the pref "devtools.performance.popup.feature-flag" and the profiler button will always be available in the list of buttons for the Firefox UI.

The popup UI is not a React Redux app, but has a vanilla browser chrome implementation. This was done to make the popup as fast as possible, with a trade-off of some complexity with dealing with the non-standard (i.e. not a normal webpage) browser chrome environment. The popup is designed to be as low overhead as possible in order to get the cleanest performance profiles. Special care must be taken to not impact browser startup times when working with this implementation, as it also turns on the global profiler shortcuts.

Injecting profiles into profiler.firefox.com

After a profile has been collected, it needs to be sent to profiler.firefox.com for analysis. This is done by using browser APIs to open a new tab, and then injecting the profile into the page through a frame script. See frame-script.js for implementation details. Both the DevTools Panel and the Popup use this frame script.