Changeset 112540 in webkit
- Timestamp:
- Mar 29, 2012 9:25:24 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112539 r112540 1 2012-03-29 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: check more likely condition first in HeapSnapshot._buildAggregates 4 https://bugs.webkit.org/show_bug.cgi?id=82621 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/HeapSnapshot.js: selfSize === 0 is quite rare, moving this condition 9 to the first place saves 1 of 6 secs on the heap profiler perf test. 10 (WebInspector.HeapSnapshot.prototype._buildAggregates): 11 (WebInspector.HeapSnapshot.prototype._buildDominatedNodes): root node is always the first 12 one and is the only one that doesn't have dominator, so we may start iterating nodes from 13 the second node and avoid additional check in the loop. 14 1 15 2012-03-29 Pavel Feldman <pfeldman@chromium.org> 2 16 -
trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js
r112523 r112540 1092 1092 if (filter && !filter(node)) 1093 1093 return true; 1094 if (!node. isNative && node.selfSize === 0)1094 if (!node.selfSize && !node.isNative) 1095 1095 return true; 1096 1096 return false; … … 1177 1177 var dominatedNodes = this._dominatedNodes = new Uint32Array(this.nodeCount - 1); 1178 1178 1179 // Count the number of dominated nodes for each node 1180 for (var nodeIndex = 0; nodeIndex < this._onlyNodes.length; nodeIndex += this._nodeFieldCount) { 1179 // Count the number of dominated nodes for each node. Skip the root (node at 1180 // index 0) as it is the only node that dominates itself. 1181 for (var nodeIndex = this._nodeFieldCount; nodeIndex < this._onlyNodes.length; nodeIndex += this._nodeFieldCount) { 1181 1182 var dominatorIndex = this._onlyNodes[nodeIndex + this._dominatorOffset]; 1182 1183 if (dominatorIndex % this._nodeFieldCount) 1183 1184 throw new Error("Wrong dominatorIndex " + dominatorIndex + " nodeIndex = " + nodeIndex + " nodeCount = " + this.nodeCount); 1184 // Skip root node. We may simplify this by starting iteration from second node.1185 if (nodeIndex === dominatorIndex) continue;1186 1185 ++indexArray[dominatorIndex / this._nodeFieldCount]; 1187 1186 } … … 1189 1188 // that will be filled. 1190 1189 var firstDominatedNodeIndex = 0; 1191 for (i = 0; i < =this.nodeCount; ++i) {1190 for (i = 0; i < this.nodeCount; ++i) { 1192 1191 var dominatedCount = dominatedNodes[firstDominatedNodeIndex] = indexArray[i]; 1193 1192 indexArray[i] = firstDominatedNodeIndex; 1194 1193 firstDominatedNodeIndex += dominatedCount; 1195 1194 } 1196 // Fill up the dominatedNodes array with indexes of dominated nodes. 1197 for (var nodeIndex = 0; nodeIndex < this._onlyNodes.length; nodeIndex += this._nodeFieldCount) { 1195 indexArray[this.nodeCount] = dominatedNodes.length; 1196 // Fill up the dominatedNodes array with indexes of dominated nodes. Skip the root (node at 1197 // index 0) as it is the only node that dominates itself. 1198 for (var nodeIndex = this._nodeFieldCount; nodeIndex < this._onlyNodes.length; nodeIndex += this._nodeFieldCount) { 1198 1199 var dominatorIndex = this._onlyNodes[nodeIndex + this._dominatorOffset]; 1199 1200 if (dominatorIndex % this._nodeFieldCount) 1200 1201 throw new Error("Wrong dominatorIndex " + dominatorIndex); 1201 if (nodeIndex === dominatorIndex) continue;1202 1202 var dominatorPos = dominatorIndex / this._nodeFieldCount; 1203 1203 var dominatedRefIndex = indexArray[dominatorPos];
Note: See TracChangeset
for help on using the changeset viewer.