See Bug 87089 - Web Inspector: MetaBug: upstream backend post-processing methods to the front-end. JS implementation is a bit slow. RESULT heap-snapshot: _calculateRetainedSizes= 266 ms vs native HeapSnapshotGenerator::CalculateRetainedSizes 61 ms I'll make it twice faster, about 130ms in the next patch.
Created attachment 143248 [details] Patch
Comment on attachment 143248 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143248&action=review > Source/WebCore/inspector/front-end/HeapSnapshot.js:1270 > + var nodeSelfSize = nodes[nodeOrdinal * nodeFieldCount + nodeSelfSizeOffset]; You can introduce a var for nodeSelfSizeIndex and use an increment to keep it up to date. > Source/WebCore/inspector/front-end/HeapSnapshot.js:1276 > + } while (currentNodeOrdinal !== prevNodeOrdinal); while (currentNodeOrdinal) would work as well as the root index is 0.
Committed r117953: <http://trac.webkit.org/changeset/117953>
(In reply to comment #0) > See Bug 87089 - Web Inspector: MetaBug: upstream backend post-processing methods to the front-end. > > JS implementation is a bit slow. > RESULT heap-snapshot: _calculateRetainedSizes= 266 ms > > vs native > > HeapSnapshotGenerator::CalculateRetainedSizes 61 ms > > I'll make it twice faster, about 130ms in the next patch. Bug 87124 - Web Inspector: HeapSnapshot: speed-up calculateRetainedSize functon. landed as r117962