binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Add a HeapSnapshotAnalysis pass

Open tlively opened this issue 10 months ago • 1 comments

Chrome and Edge DevTools can capture heap snapshots, which are JSON representations of the entire object graph at a moment in time. Add a pass that can parse such a snapshot and report statistics about how much of the heap is occupied by Wasm objects and what the top types are by cumulative heap size and allocation count.

tlively avatar Apr 11 '25 01:04 tlively

I'll add a test for this before we land it. I'm also open to suggestions of interesting analyses to run. I don't have a heap snapshot of a module with a name section, but eventually I would like to support printing details of the type definitions when I can match up names in the snapshot to names in the module.

tlively avatar Apr 11 '25 01:04 tlively