Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: Source/devtools/front_end/TimelineFlameChart.js

Issue 188293003: DevTools: minor flame chart speedups. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/TimelineFlameChart.js
diff --git a/Source/devtools/front_end/TimelineFlameChart.js b/Source/devtools/front_end/TimelineFlameChart.js
index abb0e22b5a89ccd94107f9d29009356d27d072f1..378086e8b6eba63241b16147c3c684ef2cdb4c98 100644
--- a/Source/devtools/front_end/TimelineFlameChart.js
+++ b/Source/devtools/front_end/TimelineFlameChart.js
@@ -198,32 +198,14 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
return;
}
- var recordIndex = this._pushRecord(record, true, level, record.startTime, record.endTime);
- var currentTime = record.startTime;
- for (var i = 0; i < record.children.length; ++i) {
- var childRecord = record.children[i];
- var childStartTime = childRecord.startTime;
- var childEndTime = childRecord.endTime;
- if (childStartTime === childEndTime) {
- this._appendRecord(childRecord, level + 1);
- continue;
- }
-
- if (currentTime !== childStartTime) {
- if (recordIndex !== -1) {
- this._timelineData.entryTotalTimes[recordIndex] = childStartTime - record.startTime;
- recordIndex = -1;
- } else {
- this._pushRecord(record, true, level, currentTime, childStartTime);
- }
- }
- this._pushRecord(record, false, level, childStartTime, childEndTime);
- this._appendRecord(childRecord, level + 1);
- currentTime = childEndTime;
+ if (record.children.length) {
+ this._pushRecord(record, true, level, record.startTime, record.startTime + + record.selfTime);
alph 2014/03/06 06:24:46 Something is wrong here.
pfeldman 2014/03/06 11:19:57 Done.
+ this._pushRecord(record, false, level, record.startTime + record.selfTime, record.endTime);
+ } else {
+ this._pushRecord(record, true, level, record.startTime, record.endTime);
}
- if (recordIndex === -1 && recordEndTime !== currentTime || record.children.length === 0)
- this._pushRecord(record, true, level, currentTime, recordEndTime);
-
+ for (var i = 0; i < record.children.length; ++i)
+ this._appendRecord(record.children[i], level + 1);
this._maxStackDepth = Math.max(this._maxStackDepth, level + 2);
},
@@ -336,9 +318,6 @@ WebInspector.TimelineFlameChart.prototype = {
*/
refreshRecords: function(textFilter)
{
- this._dataProvider.reset();
- this._mainView.reset();
- this.setSelectedRecord(this._selectedRecord);
},
reset: function()
@@ -346,7 +325,6 @@ WebInspector.TimelineFlameChart.prototype = {
this._automaticallySizeWindow = true;
this._dataProvider.reset();
this._mainView.setWindowTimes(0, Infinity);
- delete this._selectedRecord;
},
_onRecordingStarted: function()
@@ -412,7 +390,6 @@ WebInspector.TimelineFlameChart.prototype = {
*/
setSelectedRecord: function(record)
{
- this._selectedRecord = record;
var entryRecords = this._dataProvider._records;
for (var entryIndex = 0; entryIndex < entryRecords.length; ++entryIndex) {
if (entryRecords[entryIndex] === record) {
@@ -421,10 +398,6 @@ WebInspector.TimelineFlameChart.prototype = {
}
}
this._mainView.setSelectedEntry(-1);
- if (this._selectedElement) {
- this._selectedElement.remove();
- delete this._selectedElement;
- }
},
/**
« Source/devtools/front_end/FlameChart.js ('K') | « Source/devtools/front_end/FlameChart.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698