mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-11-04 15:00:11 +00:00
feat: Sort objects for class by self size in compare_heapsnapshots (#3205)
Show the most significant objects first for a class in `compare_heapsnapshots`.
This commit is contained in:
1 parent
fb8375bd2d
commit
f8a18c68d4
1 file changed
+3
@@ -391,6 +391,9 @@ export class HeapSnapshotManager {
|
||||
for (const [i, id] of deletedIds.entries()) {
|
||||
objects.push({id, selfSize: deletedSelfSizes[i], change: 'deleted'});
|
||||
}
|
||||
// Largest objects first so that the first page of paginated output shows
|
||||
// the most significant changes.
|
||||
objects.sort((a, b) => b.selfSize - a.selfSize);
|
||||
return {classDiff: toClassDiff(classIndex, rawDiff), objects};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user