Dot Performance Issues

We use dot to layout biological pathways in a tool we developed here at Plugin <em></em> Not Found. Recently we have come up a significant performance issue, on certain graphs dot takes an inordinately long time to layout the graphs. Usually even for large graphs, dot is quite quick. For example in a case of a Plugin <em></em> Not Found with 726 nodes, and 1499 edges, dot takes roughly 30 seconds: [visnet-83:~/Desktop/Dot bugs] iam% time dot -Tdot egf.dot -o egf1.dot 32.481u 0.062s 0:32.54 100.0% 0+0k 0+5io 0pf+0w [visnet-83:~/Desktop/Dot bugs] iam% However for a recent Plugin <em></em> Not Found that is of a comparable size (i.e. 546 nodes, and 936 edges) dot spins one CPU at 100% for almost 3 minutes: [visnet-83:~/Desktop/Dot bugs] iam% time dot -Tdot mycolate.dot -o mycolate1.dot 177.011u 0.237s 2:57.26 99.9% 0+0k 0+5io 0pf+0w [visnet-83:~/Desktop/Dot bugs] iam% Both these measurements were done using dot version 2.28.0 on a snow leopard mac book pro with a 2.53 Ghz Intel Core i5 (2 cores) and 8G of memory. Is there anything we can do to improve matters here?

Dot Performance Issues

The difference is that, when laid out, egf.dot has only 48 ranks while mycolate.dot has 272 ranks. This means that, during the actual positioning phase, the first graph needs an augmented graph with 14861 nodes and 22630 edges, while the latter has an augmented graph with 33122 nodes and 49605 edges. (Basically, the more ranks there are, the longer the edges are and the more nodes and edges required in the augmented graph.) So the first graph requires about 8700 iterations to do positioning and the latter needs about 55900 iterations.
 
You can use the nslimit attribute (http://www.graphviz.org/content/attrs#dnslimit) to limit the number of iterations used in this pass, with subsequent loss of drawing quality, but with graphs of the size you are dealing with, this may be unnoticeable.
 
In general, if you run dot with the -v flag, you will see where the program is spending its time.

Dot Performance Issues

Anonymous, 
 
Thanks for the stellar advice. We have incorporated the idea into our use of dot with the desired results. Also thanks for the -v hint. We will no doubt make use of it in future.
 
Cheers, Ian.

Recent comments