WALA
WALA copied to clipboard
how to save and load call graph
Dear author, sometimes it takes a long time to build call graph for large program
-
how to save CallGraph to disk such as dot file?
-
how to load CallGraph from disk?
@msridhar Could you give me a reply at your convenience? Thank you for your help!
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 (IMethod
s, etc.) would also need to be set up. But maybe you don't need that.