Modified: trunk/Source/WebInspectorUI/ChangeLog (243703 => 243704)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-04-01 18:46:44 UTC (rev 243703)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-04-01 18:54:36 UTC (rev 243704)
@@ -1,3 +1,35 @@
+2019-04-01 Joseph Pecoraro <pecor...@apple.com>
+
+ 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):
+
2019-03-29 Myles C. Maxfield <mmaxfi...@apple.com>
Delete WebMetal implementation in favor of WebGPU
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js (243703 => 243704)
--- trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js 2019-04-01 18:46:44 UTC (rev 243703)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js 2019-04-01 18:54:36 UTC (rev 243704)
@@ -71,9 +71,13 @@
static get indicatorViewHeight() { return 15; }
static get lowEnergyThreshold() { return 3; }
- static get mediumEnergyThreshold() { return 50; }
- static get highEnergyThreshold() { return 150; }
+ static get mediumEnergyThreshold() { return 30; }
+ static get highEnergyThreshold() { return 100; }
+ static get lowEnergyGraphBoundary() { return 10; }
+ static get mediumEnergyGraphBoundary() { return 70; }
+ static get highEnergyGraphBoundary() { return 100; }
+
static get defaultSectionLimit() { return 5; }
// Public
@@ -261,9 +265,9 @@
height: 110,
strokeWidth: 20,
segments: [
- {className: "low", limit: 10},
- {className: "medium", limit: 80},
- {className: "high", limit: 100},
+ {className: "low", limit: CPUTimelineView.lowEnergyGraphBoundary},
+ {className: "medium", limit: CPUTimelineView.mediumEnergyGraphBoundary},
+ {className: "high", limit: CPUTimelineView.highEnergyGraphBoundary},
]
});
this.addSubview(this._energyChart);
@@ -591,7 +595,7 @@
function bestThreadLayoutMax(value) {
if (value > 100)
- return Math.ceil(value);
+ return Math.ceil(value);
return (Math.floor(value / 25) + 1) * 25;
}
@@ -1102,19 +1106,19 @@
// Low. (<=3% CPU, mapped to 0-10)
this._energyImpactLabelElement.textContent = WI.UIString("Low");
this._energyImpactLabelElement.classList.add("low");
- this._energyChart.value = mapWithBias(average, 0, CPUTimelineView.lowEnergyThreshold, 0, 10, 0.85);
+ this._energyChart.value = mapWithBias(average, 0, CPUTimelineView.lowEnergyThreshold, 0, CPUTimelineView.lowEnergyGraphBoundary, 0.85);
} else if (average <= CPUTimelineView. mediumEnergyThreshold) {
- // Medium (3%-90% CPU, mapped to 10-80)
+ // Medium (3%-30% CPU, mapped to 10-70)
this._energyImpactLabelElement.textContent = WI.UIString("Medium");
this._energyImpactLabelElement.classList.add("medium");
- this._energyChart.value = mapWithBias(average, CPUTimelineView.lowEnergyThreshold, CPUTimelineView.mediumEnergyThreshold, 10, 80, 0.6);
+ this._energyChart.value = mapWithBias(average, CPUTimelineView.lowEnergyThreshold, CPUTimelineView.mediumEnergyThreshold, CPUTimelineView.lowEnergyGraphBoundary, CPUTimelineView.mediumEnergyGraphBoundary, 0.6);
} else if (average < CPUTimelineView. highEnergyThreshold) {
- // High. (50-150% CPU, mapped to 80-100)
+ // High. (30%-100% CPU, mapped to 70-100)
this._energyImpactLabelElement.textContent = WI.UIString("High");
this._energyImpactLabelElement.classList.add("high");
- this._energyChart.value = mapWithBias(average, CPUTimelineView.mediumEnergyThreshold, CPUTimelineView.highEnergyThreshold, 80, 100, 0.9);
+ this._energyChart.value = mapWithBias(average, CPUTimelineView.mediumEnergyThreshold, CPUTimelineView.highEnergyThreshold, CPUTimelineView.mediumEnergyGraphBoundary, CPUTimelineView.highEnergyGraphBoundary, 0.9);
} else {
- // Very High. (>150% CPU, mapped to 100)
+ // Very High. (>100% CPU, mapped to 100)
this._energyImpactLabelElement.textContent = WI.UIString("Very High");
this._energyImpactLabelElement.classList.add("high");
this._energyChart.value = 100;