Changeset 243704 in webkit


Ignore:
Timestamp:
Apr 1, 2019 11:54:36 AM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: CPU Usage Timeline - Adjust Energy Impact Threshholds
https://bugs.webkit.org/show_bug.cgi?id=196421
<rdar://problem/49125703>

Reviewed by Devin Rousso.

  • Low - Keep Below 3% to continue to encourage idle pages stay below 3% Might want to reduce to 2.5 or 2 after fixing bug 196419.
  • High - Make Above 30% instead of 50% to encourage long running interactivity to stay below 30% Depends on interaction, but sustained (1-2min) at 30%+ will certainly impact battery.
  • Very High - Make above 100% instead of 150% CPU Usage spikes around page load and is quite often still under 100% despite many threads. Drop this a bit as we dropped High down.

Reduce the size of the Medium section, and increase the High section
Having 70% of the chart be "Medium" is just too much Medium, and
we've now made it more possible to be in the High range.

  • UserInterface/Views/CPUTimelineView.js:

(WI.CPUTimelineView.prototype.get mediumEnergyThreshold):
(WI.CPUTimelineView.prototype.get highEnergyThreshold):
(WI.CPUTimelineView.prototype.get lowEnergyGraphBoundary):
(WI.CPUTimelineView.prototype.get mediumEnergyGraphBoundary):
(WI.CPUTimelineView.prototype.get highEnergyGraphBoundary):
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype.layout.bestThreadLayoutMax):
(WI.CPUTimelineView.prototype._layoutEnergyChart):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r243666 r243704  
     12019-04-01  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: CPU Usage Timeline - Adjust Energy Impact Threshholds
     4        https://bugs.webkit.org/show_bug.cgi?id=196421
     5        <rdar://problem/49125703>
     6
     7        Reviewed by Devin Rousso.
     8
     9        - Low - Keep Below 3% to continue to encourage idle pages stay below 3%
     10          Might want to reduce to 2.5 or 2 after fixing bug 196419.
     11
     12        - High - Make Above 30% instead of 50% to encourage long running interactivity to stay below 30%
     13          Depends on interaction, but sustained (1-2min) at 30%+ will certainly impact battery.
     14
     15        - Very High - Make above 100% instead of 150%
     16          CPU Usage spikes around page load and is quite often still under 100% despite many threads.
     17          Drop this a bit as we dropped High down.
     18
     19        Reduce the size of the Medium section, and increase the High section
     20        Having 70% of the chart be "Medium" is just too much Medium, and
     21        we've now made it more possible to be in the High range.
     22
     23        * UserInterface/Views/CPUTimelineView.js:
     24        (WI.CPUTimelineView.prototype.get mediumEnergyThreshold):
     25        (WI.CPUTimelineView.prototype.get highEnergyThreshold):
     26        (WI.CPUTimelineView.prototype.get lowEnergyGraphBoundary):
     27        (WI.CPUTimelineView.prototype.get mediumEnergyGraphBoundary):
     28        (WI.CPUTimelineView.prototype.get highEnergyGraphBoundary):
     29        (WI.CPUTimelineView.prototype.initialLayout):
     30        (WI.CPUTimelineView.prototype.layout.bestThreadLayoutMax):
     31        (WI.CPUTimelineView.prototype._layoutEnergyChart):
     32
    1332019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
    234
  • trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js

    r242740 r243704  
    7272
    7373    static get lowEnergyThreshold() { return 3; }
    74     static get mediumEnergyThreshold() { return 50; }
    75     static get highEnergyThreshold() { return 150; }
     74    static get mediumEnergyThreshold() { return 30; }
     75    static get highEnergyThreshold() { return 100; }
     76
     77    static get lowEnergyGraphBoundary() { return 10; }
     78    static get mediumEnergyGraphBoundary() { return 70; }
     79    static get highEnergyGraphBoundary() { return 100; }
    7680
    7781    static get defaultSectionLimit() { return 5; }
     
    262266            strokeWidth: 20,
    263267            segments: [
    264                 {className: "low", limit: 10},
    265                 {className: "medium", limit: 80},
    266                 {className: "high", limit: 100},
     268                {className: "low", limit: CPUTimelineView.lowEnergyGraphBoundary},
     269                {className: "medium", limit: CPUTimelineView.mediumEnergyGraphBoundary},
     270                {className: "high", limit: CPUTimelineView.highEnergyGraphBoundary},
    267271            ]
    268272        });
     
    592596        function bestThreadLayoutMax(value) {
    593597            if (value > 100)
    594                 return Math.ceil(value);           
     598                return Math.ceil(value);
    595599            return (Math.floor(value / 25) + 1) * 25;
    596600        }
     
    11031107            this._energyImpactLabelElement.textContent = WI.UIString("Low");
    11041108            this._energyImpactLabelElement.classList.add("low");
    1105             this._energyChart.value = mapWithBias(average, 0, CPUTimelineView.lowEnergyThreshold, 0, 10, 0.85);
     1109            this._energyChart.value = mapWithBias(average, 0, CPUTimelineView.lowEnergyThreshold, 0, CPUTimelineView.lowEnergyGraphBoundary, 0.85);
    11061110        } else if (average <= CPUTimelineView. mediumEnergyThreshold) {
    1107             // Medium (3%-90% CPU, mapped to 10-80)
     1111            // Medium (3%-30% CPU, mapped to 10-70)
    11081112            this._energyImpactLabelElement.textContent = WI.UIString("Medium");
    11091113            this._energyImpactLabelElement.classList.add("medium");
    1110             this._energyChart.value = mapWithBias(average, CPUTimelineView.lowEnergyThreshold, CPUTimelineView.mediumEnergyThreshold, 10, 80, 0.6);
     1114            this._energyChart.value = mapWithBias(average, CPUTimelineView.lowEnergyThreshold, CPUTimelineView.mediumEnergyThreshold, CPUTimelineView.lowEnergyGraphBoundary, CPUTimelineView.mediumEnergyGraphBoundary, 0.6);
    11111115        } else if (average < CPUTimelineView. highEnergyThreshold) {
    1112             // High. (50-150% CPU, mapped to 80-100)
     1116            // High. (30%-100% CPU, mapped to 70-100)
    11131117            this._energyImpactLabelElement.textContent = WI.UIString("High");
    11141118            this._energyImpactLabelElement.classList.add("high");
    1115             this._energyChart.value = mapWithBias(average, CPUTimelineView.mediumEnergyThreshold, CPUTimelineView.highEnergyThreshold, 80, 100, 0.9);
     1119            this._energyChart.value = mapWithBias(average, CPUTimelineView.mediumEnergyThreshold, CPUTimelineView.highEnergyThreshold, CPUTimelineView.mediumEnergyGraphBoundary, CPUTimelineView.highEnergyGraphBoundary, 0.9);
    11161120        } else {
    1117             // Very High. (>150% CPU, mapped to 100)
     1121            // Very High. (>100% CPU, mapped to 100)
    11181122            this._energyImpactLabelElement.textContent = WI.UIString("Very High");
    11191123            this._energyImpactLabelElement.classList.add("high");
Note: See TracChangeset for help on using the changeset viewer.