Skip to content

Commit 09314f8

Browse files
sethbrenithDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Make heap snapshot diffs more accurate
When comparing two heap snapshots, devtools will sometimes report that an object was deleted and created, despite the object having the same ID in both snapshots. This can happen because calculateDiffForClass expects both lists of nodes to be sorted by ID, but the lists aren't always sorted. It appears that getAggregatesByClassName(true, 'allObjects') should produce sorted results due to passing true as the first argument, but it is sorting the wrong collection. Bug: chromium:1286500 Change-Id: I73e68179cdfee1c6beacf04ecef5824e6245f8ac Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4279830 Reviewed-by: Simon Zünd Commit-Queue: Seth Brenith
1 parent 80ee7f8 commit 09314f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ export abstract class HeapSnapshot {
10021002
}
10031003

10041004
if (sortedIndexes && (!key || !this.#aggregatesSortedFlags[key])) {
1005-
this.sortAggregateIndexes(aggregates.aggregatesByClassName);
1005+
this.sortAggregateIndexes(aggregatesByClassName);
10061006
if (key) {
10071007
this.#aggregatesSortedFlags[key] = sortedIndexes;
10081008
}

0 commit comments

Comments
 (0)