Bug 1489745 - reduce overhead of the performance test that also selects the memory r=gregtatum
authorJulien Wajsberg <felash@gmail.com>
Wed, 24 Oct 2018 12:09:45 +0000
changeset 491116 33b1c05d92a70b51b12f08484637f9999f2c9976
parent 491115 2485564ba1b4ccf49e14fcc783e2f22b950fb094
child 491117 399c3dbac7e2cb48a317268cf3593236fa826e64
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersgregtatum
bugs1489745
milestone65.0a1
Bug 1489745 - reduce overhead of the performance test that also selects the memory r=gregtatum In this patch we use the previous change to reduce the overhead in the specific test that fails in ccov builds, by reducing the sample frequency. Depends on D8548 Differential Revision: https://phabricator.services.mozilla.com/D8435
devtools/client/performance/test/browser_perf-recording-selected-04.js
--- a/devtools/client/performance/test/browser_perf-recording-selected-04.js
+++ b/devtools/client/performance/test/browser_perf-recording-selected-04.js
@@ -2,17 +2,21 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 /**
  * Tests that all components can get rerendered for a profile when switching.
  */
 
 const { SIMPLE_URL } = require("devtools/client/performance/test/helpers/urls");
-const { UI_ENABLE_MEMORY_PREF, UI_ENABLE_ALLOCATIONS_PREF } = require("devtools/client/performance/test/helpers/prefs");
+const {
+  UI_ENABLE_MEMORY_PREF,
+  UI_ENABLE_ALLOCATIONS_PREF,
+  PROFILER_SAMPLE_RATE_PREF,
+} = require("devtools/client/performance/test/helpers/prefs");
 const { initPerformanceInNewTab, teardownToolboxAndRemoveTab } = require("devtools/client/performance/test/helpers/panel-utils");
 const { startRecording, stopRecording, waitForAllWidgetsRendered } = require("devtools/client/performance/test/helpers/actions");
 const { setSelectedRecording } = require("devtools/client/performance/test/helpers/recording-utils");
 
 add_task(async function() {
   const { panel } = await initPerformanceInNewTab({
     url: SIMPLE_URL,
     win: window,
@@ -21,20 +25,28 @@ add_task(async function() {
   const { DetailsView, DetailsSubview } = panel.panelWin;
 
   // Enable memory to test the memory overview.
   Services.prefs.setBoolPref(UI_ENABLE_MEMORY_PREF, true);
 
   // Enable allocations to test the memory-calltree and memory-flamegraph.
   Services.prefs.setBoolPref(UI_ENABLE_ALLOCATIONS_PREF, true);
 
+  // Because enabling the memory panel has a significant overhead, especially in
+  // slow builds like ccov builds, let's reduce the overhead from the sampling.
+  Services.prefs.setIntPref(PROFILER_SAMPLE_RATE_PREF, 100);
+
+  ok(true, "Starting recording...");
   await startRecording(panel);
+  ok(true, "Recording started!");
+  ok(true, "Stopping recording...");
   await stopRecording(panel);
+  ok(true, "Recording stopped!");
 
-  // Ã…llow widgets to be updated while hidden, to make testing easier.
+  // Allow widgets to be updated while hidden, to make testing easier.
   DetailsSubview.canUpdateWhileHidden = true;
 
   // Cycle through all the views to initialize them. The waterfall is shown
   // by default, but all the other views are created lazily, so won't emit
   // any events.
   await DetailsView.selectView("js-calltree");
   await DetailsView.selectView("js-flamegraph");
   await DetailsView.selectView("memory-calltree");