https://bugs.webkit.org/show_bug.cgi?id=83682
Node content is created only when the node becomes visible in the corresponding view.
This saves a lot of time when openning summary/comparison view of a snapshot
with lots of different classes.
Reviewed by Pavel Feldman.
* inspector/front-end/DetailedHeapshotGridNodes.js:
(WebInspector.HeapSnapshotGridNode.prototype.ensureContentCreated):
(WebInspector.HeapSnapshotLazyGridNode):
(WebInspector.HeapSnapshotLazyGridNode.prototype.ensureContentCreated):
(WebInspector.HeapSnapshotLazyGridNode.prototype.createCells):
(WebInspector.HeapSnapshotConstructorNode):
(WebInspector.HeapSnapshotDiffNode):
* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.HeapSnapshotSortableDataGrid):
(WebInspector.HeapSnapshotSortableDataGrid.prototype.updateVisibleNodes):
(WebInspector.HeapSnapshotSortableDataGrid.prototype.onResize):
(WebInspector.HeapSnapshotSortableDataGrid.prototype._onScroll):
(WebInspector.HeapSnapshotSortableDataGrid.prototype._performSorting):
(WebInspector.HeapSnapshotConstructorsDataGrid):
(WebInspector.HeapSnapshotDiffDataGrid):
(WebInspector.DetailedHeapshotView.prototype._changeNameFilter):
* inspector/front-end/heapProfiler.css:
(.detailed-heapshot-view .data-grid tr:empty):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113851
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-11 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: showing summary view is very slow on a snapshot with thousands of constructors
+ https://bugs.webkit.org/show_bug.cgi?id=83682
+
+ Node content is created only when the node becomes visible in the corresponding view.
+ This saves a lot of time when openning summary/comparison view of a snapshot
+ with lots of different classes.
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/front-end/DetailedHeapshotGridNodes.js:
+ (WebInspector.HeapSnapshotGridNode.prototype.ensureContentCreated):
+ (WebInspector.HeapSnapshotLazyGridNode):
+ (WebInspector.HeapSnapshotLazyGridNode.prototype.ensureContentCreated):
+ (WebInspector.HeapSnapshotLazyGridNode.prototype.createCells):
+ (WebInspector.HeapSnapshotConstructorNode):
+ (WebInspector.HeapSnapshotDiffNode):
+ * inspector/front-end/DetailedHeapshotView.js:
+ (WebInspector.HeapSnapshotSortableDataGrid):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.updateVisibleNodes):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype.onResize):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype._onScroll):
+ (WebInspector.HeapSnapshotSortableDataGrid.prototype._performSorting):
+ (WebInspector.HeapSnapshotConstructorsDataGrid):
+ (WebInspector.HeapSnapshotDiffDataGrid):
+ (WebInspector.DetailedHeapshotView.prototype._changeNameFilter):
+ * inspector/front-end/heapProfiler.css:
+ (.detailed-heapshot-view .data-grid tr:empty):
+
2012-04-11 Simon Pena <spena@igalia.com>
[GTK] media/event-attributes.html fails
}
WebInspector.HeapSnapshotGridNode.prototype = {
+ ensureContentCreated: function()
+ {
+ // May be overriden in descendants with lazy content.
+ },
+
createCell: function(columnIdentifier)
{
var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
WebInspector.HeapSnapshotGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
+WebInspector.HeapSnapshotLazyGridNode = function(tree, hasChildren)
+{
+ WebInspector.HeapSnapshotGridNode.call(this, tree, hasChildren);
+ this._deferContentCreation = true;
+}
+
+WebInspector.HeapSnapshotLazyGridNode.prototype = {
+ ensureContentCreated: function()
+ {
+ if (!this._deferContentCreation)
+ return;
+ this._deferContentCreation = false;
+ this.createCells();
+ },
+
+ createCells: function()
+ {
+ if (this._deferContentCreation)
+ return;
+ WebInspector.HeapSnapshotGridNode.prototype.createCells.call(this);
+ }
+};
+
+WebInspector.HeapSnapshotLazyGridNode.prototype.__proto__ = WebInspector.HeapSnapshotGridNode.prototype;
+
WebInspector.HeapSnapshotGenericObjectNode = function(tree, node)
{
WebInspector.HeapSnapshotGridNode.call(this, tree, false);
WebInspector.HeapSnapshotConstructorNode = function(tree, className, aggregate, aggregatesKey)
{
- WebInspector.HeapSnapshotGridNode.call(this, tree, aggregate.count > 0);
+ WebInspector.HeapSnapshotLazyGridNode.call(this, tree, aggregate.count > 0);
this._name = className;
this._distanceToWindow = aggregate.distanceToWindow;
this._count = aggregate.count;
}
};
-WebInspector.HeapSnapshotConstructorNode.prototype.__proto__ = WebInspector.HeapSnapshotGridNode.prototype;
+WebInspector.HeapSnapshotConstructorNode.prototype.__proto__ = WebInspector.HeapSnapshotLazyGridNode.prototype;
WebInspector.HeapSnapshotIteratorsTuple = function(it1, it2)
{
WebInspector.HeapSnapshotDiffNode = function(tree, className, baseAggregate, aggregate)
{
- WebInspector.HeapSnapshotGridNode.call(this, tree, true);
+ WebInspector.HeapSnapshotLazyGridNode.call(this, tree, true);
this._name = className;
this._baseIndexes = baseAggregate ? baseAggregate.idxs : [];
this._indexes = aggregate ? aggregate.idxs : [];
}
};
-WebInspector.HeapSnapshotDiffNode.prototype.__proto__ = WebInspector.HeapSnapshotGridNode.prototype;
+WebInspector.HeapSnapshotDiffNode.prototype.__proto__ = WebInspector.HeapSnapshotLazyGridNode.prototype;
WebInspector.HeapSnapshotDominatorObjectNode = function(tree, node)
{
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.HeapSnapshotSortableDataGrid = function(columns)
+WebInspector.HeapSnapshotSortableDataGrid = function(columns, deferNodeContentCreation)
{
WebInspector.DataGrid.call(this, columns);
this.addEventListener("sorting changed", this.sortingChanged, this);
+
+ this._deferNodeContentCreation = deferNodeContentCreation;
+ if (deferNodeContentCreation)
+ this.scrollContainer.addEventListener("scroll", this._onScroll.bind(this), true);
}
WebInspector.HeapSnapshotSortableDataGrid.prototype = {
this._performSorting(SortByTwoFields);
},
+ updateVisibleNodes: function()
+ {
+ if (!this._deferNodeContentCreation)
+ return;
+ var scrollTop = this.scrollContainer.scrollTop;
+ var rowHeight = 16;
+
+ var height = this.scrollContainer.offsetHeight;
+ var visibleRowsCount = Math.round(height / rowHeight) + 1;
+
+ var children = this.children;
+
+ var i = 0;
+ while (i < children.length) {
+ if (children[i].revealed) {
+ var top = children[i].element.offsetTop;
+ if (top >= scrollTop)
+ break;
+ }
+ ++i;
+ }
+
+ while (i < children.length && visibleRowsCount) {
+ if (children[i].revealed) {
+ children[i].ensureContentCreated();
+ --visibleRowsCount;
+ }
+ ++i;
+ }
+ },
+
+ onResize: function()
+ {
+ this.updateVisibleNodes();
+ },
+
+ _onScroll: function(event)
+ {
+ this.updateVisibleNodes();
+ },
+
_performSorting: function(sortFunction)
{
this.recursiveSortingEnter();
child.sort();
}
this.recursiveSortingLeave();
+ this.updateVisibleNodes();
},
recursiveSortingEnter: function()
shallowSize: { title: WebInspector.UIString("Shallow Size"), width: "120px", sortable: true },
retainedSize: { title: WebInspector.UIString("Retained Size"), width: "120px", sort: "descending", sortable: true }
};
- WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
+ WebInspector.HeapSnapshotSortableDataGrid.call(this, columns, true);
this._profileIndex = -1;
}
removedSize: { title: WebInspector.UIString("Freed Size"), width: "72px", sortable: true },
sizeDelta: { title: "Size Delta", width: "72px", sortable: true }
};
- WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
+ WebInspector.HeapSnapshotSortableDataGrid.call(this, columns, true);
}
WebInspector.HeapSnapshotDiffDataGrid.prototype = {
if (node.depth === 0)
node.revealed = node._name.toLowerCase().indexOf(filter) !== -1;
}
+ this.dataGrid.updateVisibleNodes();
},
_profiles: function()
display: block;
}
+.detailed-heapshot-view .data-grid tr:empty {
+ height: 16px;
+ visibility: hidden;
+}
+
.detailed-heapshot-view .data-grid {
border: none;
}