gecko-dev/devtools/client/performance-new
Tooru Fujisawa 83cffbf4a5 Bug 1667455 - Part 23: Update DevTools TypeScript support. r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D151270
2022-07-11 12:41:58 +00:00
..
@types Bug 1667455 - Part 23: Update DevTools TypeScript support. r=julienw 2022-07-11 12:41:58 +00:00
aboutprofiling Bug 1742696 - Opt-in a bunch of about:pages to dark system colors / form controls. r=Gijs,preferences-reviewers,webcompat-reviewers,twisniewski 2021-11-25 21:24:43 +00:00
components Bug 1776594 - Switch to using grid for the range slider rows r=julienw 2022-06-27 15:00:46 +00:00
popup Bug 1667455 - Part 7: Stop importing Services.jsm from chrome-priv JS code, lazy cases. r=kmag 2022-07-11 12:41:51 +00:00
store Bug 1758792 - [devtools] Remove private browsing lock from performance front end r=julienw,devtools-backward-compat-reviewers 2022-03-11 09:32:23 +00:00
test Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop 2022-07-11 12:41:50 +00:00
.eslintrc.js
README.md
browser.js Bug 1771173 - Remove unused imports. r=geckoview-reviewers,arai,owlish 2022-06-21 20:42:16 +00:00
index.xhtml Bug 1695253 - Replaced DTD/xhtml1-strict.dtd which lead to broken network loads. r=mossop 2021-03-24 16:52:06 +00:00
initializer.js Bug 1639716 - [devtools performance] Capture profiles only in non-private windows r=jdescottes 2022-01-26 17:26:23 +00:00
moz.build Bug 1721109 - Move ProfilerGetSymbols code out of toolkit/components/extensions and into devtools directories. r=canaltinova 2021-07-29 20:28:44 +00:00
package.json Bug 1721109 - Update TypeScript dependencies. r=canaltinova 2021-07-29 20:28:44 +00:00
panel.js Bug 1758792 - [devtools] Remove private browsing lock from performance front end r=julienw,devtools-backward-compat-reviewers 2022-03-11 09:32:23 +00:00
profiler_get_symbols.js Bug 1745978 - Add the ability to fetch source code from disk to the Profiler WebChannel's querySymbolicationApi method. r=canaltinova 2021-12-17 11:11:48 +00:00
symbolication-worker.js Bug 1766099 - Part 2: Explicitly specify import or imported symbol for importScripts in devtools/. r=Standard8 2022-04-27 11:40:40 +00:00
symbolication.jsm.js Bug 1772093 - Part 10: Use plain object for lazy getter in devtools/client/performance-new/symbolication.jsm.js. r=julienw,mstange 2022-06-06 07:09:55 +00:00
tsconfig.json
typescript-lazy-load.jsm.js Bug 1610653 - Part 23: Stop using global this to define variable in devtools/. r=canaltinova 2022-05-30 15:19:43 +00:00
typescript.md Bug 1673419 - [devtools] Support performance-new typescript checks in devtools node try runner r=gregtatum,nchevobbe 2020-10-30 17:15:55 +00:00
utils.js Bug 1774844 - Record per process power use on Apple Silicon, r=gerald. 2022-06-29 21:24:12 +00:00
yarn.lock Bug 1721109 - Update TypeScript dependencies. r=canaltinova 2021-07-29 20:28:44 +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.