It gives us no performance gain but gives us the flexibility for future improvements.
Created attachment 135529 [details] Patch
Created attachment 135579 [details] Patch
Comment on attachment 135579 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135579&action=review > Source/WebCore/ChangeLog:15 > +2012-04-04 Ilya Tikhonovsky <loislo@chromium.org> Remove duplicate entry. > Source/WebCore/inspector/front-end/HeapSnapshot.js:1136 > + for (var nodeIndex = this._rootNodeIndex; nodeIndex < onlyNodesLength; nodeIndex += nodeFieldsCount) { We may want to extract this loop into its own method so that we can measure its performance without _calculateClassesRetainedSize. WDYT? > Source/WebCore/inspector/front-end/HeapSnapshot.js:1138 > + var selfSize = onlyNodes[nodeIndex + selfSizeOffset]; Given that in other places here we use "node" to get corresponding field value I'd rather use it here as well for consistency. Does it have any impact on the performance of this method? > Source/WebCore/inspector/front-end/HeapSnapshot.js:1195 > + var dominatedIndexFrom = firstDominatedNodeIndex[nodeIndex / nodeFieldCount]; var nodeOrdinal = nodeIndex / nodeFieldCount; ?
Created attachment 135588 [details] Patch
(In reply to comment #3) > (From update of attachment 135579 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=135579&action=review > > > Source/WebCore/ChangeLog:15 > > +2012-04-04 Ilya Tikhonovsky <loislo@chromium.org (:loislo) (c)> > > Remove duplicate entry. done. > > > Source/WebCore/inspector/front-end/HeapSnapshot.js:1136 > > + for (var nodeIndex = this._rootNodeIndex; nodeIndex < onlyNodesLength; nodeIndex += nodeFieldsCount) { > > We may want to extract this loop into its own method so that we can measure its performance without _calculateClassesRetainedSize. WDYT? > > > Source/WebCore/inspector/front-end/HeapSnapshot.js:1138 > > + var selfSize = onlyNodes[nodeIndex + selfSizeOffset]; > > Given that in other places here we use "node" to get corresponding field value I'd rather use it here as well for consistency. Does it have any impact on the performance of this method? v8 doesn't inline our getters. I'd like to inline classIndex too but it a separate patch. Also in general we have no control over filter function. > > > Source/WebCore/inspector/front-end/HeapSnapshot.js:1195 > > + var dominatedIndexFrom = firstDominatedNodeIndex[nodeIndex / nodeFieldCount]; > > var nodeOrdinal = nodeIndex / nodeFieldCount; ? done
lgtm
Committed r113194: <http://trac.webkit.org/changeset/113194>