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

how to save and load call graph #1255

Open
xxwxxwen opened this issue Mar 7, 2023 · 1 comment
Open

how to save and load call graph #1255

xxwxxwen opened this issue Mar 7, 2023 · 1 comment

Comments

@xxwxxwen
Copy link

xxwxxwen commented Mar 7, 2023

Dear author, sometimes it takes a long time to build call graph for large program

  1. how to save CallGraph to disk such as dot file?

  2. how to load CallGraph from disk?

@msridhar Could you give me a reply at your convenience? Thank you for your help!

@msridhar
Copy link
Member

msridhar commented Mar 7, 2023

There is code here to serialize JavaScript call graphs to JSON:

https://github.com/wala/WALA/blob/6f9d1372f0d7b4fb8e42e8622ceb37e328912b08/cast/js/src/main/java/com/ibm/wala/cast/js/util/CallGraph2JSON.java

I think a similar approach would work for serializing Java call graphs to disk. If you could make a version of this code that works for Java, we'd welcome a PR! For very large call graphs, you might need to look into streaming out the JSON, to avoid running out of memory.

I think reloading such serialized call graphs into WALA would be more work, as all the other auxiliary data structures (IMethods, etc.) would also need to be set up. But maybe you don't need that.

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

No branches or pull requests

2 participants