speed issue with pydot versus dot from command

22 views
Skip to first unread message

Laurent F.

unread,
Apr 2, 2009, 12:23:08 PM4/2/09
to pydot
Hello,

I am concerned with displaying svg graphics from a dot description
with the better speed.

I were using dot directly in Python like this:
commands.getoutput('cat %s | dot -Tsvg'%dotfile)

and I tried using pydot like:
g=pydot.graph_from_dot_data(data)
out = g.create(prog='dot',format='svg')

and the result is that direct dot has far better performances than
pydot.

Am I using pydot the wrong way ?

I hope that when you have data in memory, pydot will not create some
temporary file for dot.

Could you explain those bad results or tell me how to get better
performance than with the dot command.

Thanks,

Laurent

Ero Carrera

unread,
Apr 3, 2009, 5:23:57 AM4/3/09
to pydot

pydot is just a python tool to work with the dot graph format, it will
eventually just call dot in the command line.
In this case there's the additional overhead of having pydot parse the
whole input, generate the representation for the graph and then dump
it to a temporary file to be consumed by dot. So as you can see it
will never be even close in speed as compared to simply running dot on
a .dot file directly.

--
ero
Reply all
Reply to author
Forward
0 new messages