I found that in all dominators related functions we use nodeOrdinals. At the moment we divide nodeIndex to nodeFieldCount and this operation too expensive for these simple algorithms.
RESULT heap-snapshot: _calculateRetainedSizes= 245 ms RESULT heap-snapshot: _buildDominatedNodes= 33 ms vs RESULT heap-snapshot: _calculateRetainedSizes= 87 ms RESULT heap-snapshot: _buildDominatedNodes= 15 ms
Created attachment 143290 [details] Patch
Comment on attachment 143290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143290&action=review > Source/WebCore/inspector/front-end/HeapSnapshot.js:462 > + return this._snapshot._dominatorsTree[this.nodeIndex / this._snapshot._nodeFieldCount] * nodeFieldCount; this._snapshot._nodeFieldCount -> nodeFieldCount
Committed r117962: <http://trac.webkit.org/changeset/117962>