Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a conversion to fgl Graph #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

infinity0
Copy link

Hi Joachim! Here's a PR that converts a HeapGraph to a fgl Graph, which you can use to do More Things with it such as output to DOT format.

ghc-vis definitely looks way more sophisticated (and it uses both ghc-heap-view and graphviz) but it looks like it's been broken for several years now sadly.

@infinity0
Copy link
Author

I forgot to mention, some parts could be tidied up, for example I exposed some internal functions. I could move these to an Internal module to keep the current API as clean as it is. But that would require moving a lot of things around so I've left it out so the PR is easier to review.

@Avi-D-coder
Copy link

@infinity0 checkout https://github.com/Avi-D-coder/ghc-heap-graph, it was working, but is disappointing.
I tried to get ghc-vis working, but it kept segfaulting so I re implemented it's core feature.

Unfortunately heap graphs on there own are not very useful, so I started working on a more promising aproch using ghc-generics for metadata and heap view where you can't in watch-trac.

@infinity0
Copy link
Author

@Avi-D-coder that's cool, do you have some sample output? Here is mine (warning very large SVG, 3.3MB).

I notice in your code you're not attempting to compact list and string which is what this PR does - it reuses the compacting logic in ppHeapGraph. Is that what you mean by "not very useful", otherwise I'm not sure what you mean. Are you trying to recreate the functionality of ghc-vis, or what?

@Avi-D-coder
Copy link

Avi-D-coder commented Jun 13, 2020

I don't remember my rational, for lists and strings, but in general the output was too big and noisy for my purpose.
I wanted state diffs, replay, rendering any lazy data Generic a when appropriate (not just lists and strings), Generic was a good fit for encoding metadata, the plan was to cache the meta data and use it anywhere that the Type occurred in the heap, while periodically taking snapshots of the requested structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants