Bug 1668218 - [devtools] Enable new perf panel on Nightly. r=julienw,jdescottes.
☠☠ backed out by 7d089aec8ffc ☠ ☠
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Wed, 10 Feb 2021 15:36:20 +0000
changeset 566833 7dcb92850f2201721f997658ef72ee51bf513909
parent 566832 2443341cb2526439e5708b7d8443f714115602b0
child 566834 734d6233d1cdab2a6d50d1385de64bc5207a542f
push id38191
push userbtara@mozilla.com
push dateThu, 11 Feb 2021 05:02:45 +0000
treeherdermozilla-central@5cbcb80f72bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjulienw, jdescottes
bugs1668218
milestone87.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1668218 - [devtools] Enable new perf panel on Nightly. r=julienw,jdescottes. Differential Revision: https://phabricator.services.mozilla.com/D104206
browser/app/profile/firefox.js
devtools/client/definitions.js
devtools/client/performance/test/head.js
devtools/client/performance/test/helpers/prefs.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -2401,18 +2401,22 @@ pref("devtools.browserconsole.input.edit
 
 // Editor width for webconsole and browserconsole.
 pref("devtools.webconsole.input.editorWidth", 0);
 pref("devtools.browserconsole.input.editorWidth", 0);
 
 // Display an onboarding UI for the Editor mode.
 pref("devtools.webconsole.input.editorOnboarding", true);
 
-// Disable the new performance recording panel by default
-pref("devtools.performance.new-panel-enabled", false);
+// Enable the new performance recording panel in Nightly builds.
+#if defined(NIGHTLY_BUILD)
+  pref("devtools.performance.new-panel-enabled", true);
+#else
+  pref("devtools.performance.new-panel-enabled", false);
+#endif
 
 // Enable message grouping in the console, true by default
 pref("devtools.webconsole.groupWarningMessages", true);
 
 // Saved state of the Display content messages checkbox in the browser console.
 pref("devtools.browserconsole.contentMessages", false);
 
 // Enable client-side mapping service for source maps
--- a/devtools/client/definitions.js
+++ b/devtools/client/definitions.js
@@ -273,22 +273,21 @@ function switchPerformancePanel() {
     Services.prefs.getBoolPref("devtools.performance.new-panel-enabled", false)
   ) {
     Tools.performance.url =
       "chrome://devtools/content/performance-new/index.xhtml";
     Tools.performance.build = function(frame, target) {
       return new NewPerformancePanel(frame, target);
     };
     Tools.performance.isTargetSupported = function(target) {
-      // Root actors are lazily initialized, so we can't check if the target has
-      // the perf actor yet. Also this function is not async, so we can't initialize
-      // the actor yet.
-      // We don't display the new performance panel for remote context in the
-      // toolbox, because this has an overhead. Instead we should use
-      // about:debugging.
+      // Only use the new performance panel on local tab toolboxes, as they are guaranteed
+      // to have a performance actor.
+      // Remote tab toolboxes (eg about:devtools-toolbox from about:debugging) should not
+      // use the performance panel; about:debugging provides a "Profile performance" button
+      // which can be used instead, without having the overhead of starting a remote toolbox.
       return target.isLocalTab;
     };
   } else {
     Tools.performance.url = "chrome://devtools/content/performance/index.xhtml";
     Tools.performance.build = function(frame, target) {
       return new PerformancePanel(frame, target);
     };
     Tools.performance.isTargetSupported = function(target) {
--- a/devtools/client/performance/test/head.js
+++ b/devtools/client/performance/test/head.js
@@ -91,16 +91,19 @@ const key = (id, win = window) => {
   // TODO: remove when we have flame charts via bug 1148663.
   Services.prefs.setBoolPref(PrefUtils.UI_ENABLE_MEMORY_FLAME_CHART, true);
 
   // By default, reduce the default buffer size to reduce the overhead when
   // transfering the profile data. Hopefully this should help to reduce our
   // intermittents for the performance tests.
   Services.prefs.setIntPref(PrefUtils.PROFILER_BUFFER_SIZE_PREF, 100000);
 
+  // Force the old panel
+  Services.prefs.setBoolPref("devtools.performance.new-panel-enabled", false);
+
   registerCleanupFunction(() => {
     info("finish() was called, cleaning up...");
 
     PrefUtils.rollbackPrefsToDefault();
     stopObservingPrefs();
 
     // Manually stop the profiler module at the end of all tests, to hopefully
     // avoid at least some leaks on OSX. Theoretically the module should never
--- a/devtools/client/performance/test/helpers/prefs.js
+++ b/devtools/client/performance/test/helpers/prefs.js
@@ -44,16 +44,17 @@ exports.DEFAULT_PREF_VALUES = [
   exports.UI_SHOW_PLATFORM_DATA_PREF,
   exports.UI_SHOW_IDLE_BLOCKS_PREF,
   exports.UI_ENABLE_FRAMERATE_PREF,
   exports.UI_ENABLE_MEMORY_PREF,
   exports.UI_ENABLE_ALLOCATIONS_PREF,
   exports.UI_ENABLE_MEMORY_FLAME_CHART,
   "devtools.performance.ui.show-jit-optimizations",
   "devtools.performance.ui.show-triggers-for-gc-types",
+  "devtools.performance.new-panel-enabled",
 ].reduce((prefValues, prefName) => {
   prefValues[prefName] = Preferences.get(prefName);
   return prefValues;
 }, {});
 
 /**
  * Invokes callback when a pref which is not in the `DEFAULT_PREF_VALUES` store
  * is changed. Returns a cleanup function.