bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.17k stars 392 forks source link

Generate the output of "memray tree" in a html format with support to collapse/expand sub trees #497

Closed caravin closed 9 months ago

caravin commented 10 months ago

Is there an existing proposal for this?

Is your feature request related to a problem?

Problem: When checking the output of memray tree in terminal, due to its huge size (~2500 lines), it was hard to follow or understand the tree structure even after saving the output to a file.

Describe the solution you'd like

Solution: The same tree style output can be generated from the output. A new option by the name --html can be added to the memray tree command and when provided, the output will be generated as a html file where users can interact with the output by collapsing/expanding on sub trees.

Alternatives you considered

For having an interactive experience, I can only think of html style output for memray tree

godlygeek commented 10 months ago

499 is an alternative option here: this gives an interactive experience for expanding and collapsing different subtrees in the terminal, leveraging Textual.

pablogsal commented 9 months ago

Closing this as #499 supports mostly what you want.