-
-
Notifications
You must be signed in to change notification settings - Fork 110
Callgraph taking a while to build #558
Copy link
Copy link
Closed
Description
I am building a tool that will consume graph representations of programs to perform a task. SootUp has been a great tool for this project. I want to be able to build call graphs for arbitrary functions in a library. I created the following function to build Call Graphs for every method in a given project:
public void buildCallGraphs(){
for(JavaSootClass aClass : this.localView.getClasses()){
for(SootMethod aMethod : aClass.getMethods()){
System.out.println(aMethod.toString());
MethodSignature entryMethodSignature = aMethod.getSignature();
CallGraphAlgorithm cha = new ClassHierarchyAnalysisAlgorithm(globalView, typeHierarchy);
CallGraph cg = cha.initialize(Collections.singletonList(entryMethodSignature));
System.out.println("CALLS");
for(MethodSignature m:cg.callsFrom(entryMethodSignature)){
System.out.println(m.getName());
}
System.out.println("CALLS END");
}
}
}When I run this code, some iterations finish almost instantly, while others take over 10 minutes. I understand building the call graph can be expensive, but this seems high. Does this seem expected? For reference, I am testing it on the linear algebra for java library.
It seems the methods that take longer produce the warnings like the following:
[main] WARN sootup.callgraph.AbstractCallGraphAlgorithm - Could not find "java.lang.Object invokeBasic(java.lang.invoke.BoundMethodHandle)" in MethodHandle and in its superclasses
Is this a coincidence or a cause?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels