GraphBuilder performance
Hi,
I'm writing code to build a graph of 2500 nodes with an average of 5 edges per node. Calling builder.initialize() takes a very long time.
I used YourKit to capture CPU profiling data for the first 5 minutes of building the graph, YourKit tells me that 82% of the time is spent in GraphBuilderImpl.addEdge. 33% is spent in GraphDataMaps.getNodeDataMap. 25% (of total runtime) is spent just in Class.getInterfaces and Class.getSuperclass. Is there something I can do to speed it up? Also, do you recommend a particular layouter for a graph this large and sparse?
Also, this API could realllly use some javadoc. It hasn't been super difficult to wade through the API but I get the impression that I'm not getting the most out of it because I don't know what half the methods do.
Thanks
Keith
请先登录再写评论。
I have more data. It took 1 minute 5 seconds to build a graph of 50 nodes and 250 edges with YourKit enabled:
8 seconds spent in my code building the graph
14 seconds total in GraphBase.wrap
35 seconds total in GraphBase.unwrap
21 seconds in GraphBuilderImpl b()->d()->f()->isNodeWasCreated
23 seconds in GraphBuilderImpl c() (most if it in isNodeWasCreated)
29 seconds total in Class.getInterfaces
Without YK enabled:
- 1:04 to build a graph of 100 nodes and 500 edges.
- 1:17 to build a graph of 150 nodes and 1000 edges.
- 49:15 to build a graph of 2500 nodes and 15000 edges.
Hi Keith, could you file a request and attach your screenshots?
Okay, I filed http://jetbrains.net/jira/browse/IDEA-11416 and http://jetbrains.net/jira/browse/IDEA-11417