mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 09:22:12 +00:00
6b1e9bbdfe
Currently the HeapSnapshotGraph represents the objects in the Dart VM heap and how they relate to each other. They effectively form a directed graph with a specific root node. The API does allow traversing the graph by following an object's outgoing references. Though in certain situations it can be very useful to know the set of objects referencing a given object (i.e. incoming references). This CL adds such support, thereby allowing traversing edges in both directions: Finding what an object references and who references an object. When loading a snapshot we therefore have to also compute the reverse edges and store them. To offset any additional computation time and memory consumption, we optimize the existing implementation by not using growable List<int> objects for outgoing edges but rather typed-data views into the existing Uint32List of edges. Due to this optimization we make loading of snapshot faster and smaller, in a simple benchmark we seem to get: * JIT: 10% faster, 40% less RAM * AOT: 30% faster, 40% less RAM despite the additional compute & data structures of this API. TEST=vm/dart{,_2}/heap_snapshot_referencees_test Change-Id: Ief30bfb58c70364744eeb7f69967dd1f72ece807 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260524 Reviewed-by: Tess Strickland <sstrickl@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com> |
||
---|---|---|
.. | ||
src | ||
utils.dart | ||
vm_service.dart | ||
vm_service_io.dart |