Graph-Easy-Manual

 view release on metacpan or  search on metacpan

doc/manual/benchmark.html  view on Meta::CPAN


<h2>Benchmarks</h2>

<div class="text">

<p>
From version v0.25 onwards Graph::Easy no longer uses the
<a href="http://search.cpan.org/~jhi/Graph/">Graph</a> module. This
page explains why and also documents time and memory benchmarks
across different software versions and graph sizes. It also compares
the performance of Graph::Easy vs. <code>dot</code>.
</p>

<p>
Unless otherwise noted, the benchmarks were done on the following
system:
</p>

<table class="features">
<caption>System specs</caption>

<tr>
  <th>CPU</th>
  <td>
  <pre class="table">
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Athlon(tm) XP 2400+
stepping        : 1
cpu MHz         : 2010.963
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr
                  pge mca cmov pat pse36 mmx fxsr sse syscall
                  mmxext 3dnowext 3dnow
bogomips        : 3964.92 </pre></td>
</tr>
<tr>
  <th>OS</th>
  <td>SuSE 9.1</td>
</tr>
<tr>
  <th>Kernel</th>
  <td>2.6.5-7.201-default</td>
</tr>
<tr>
  <th>gcc</th>
  <td>3.3.3</td>
</tr>
<tr>
  <th>Perl</th>
  <td>This is perl, v5.8.6 built for i686-linux (32 bit)</td>
</tr>
<tr>
  <th>Memory</th>
  <td>
  <pre class="table">
MemTotal:      1035680 kB
SwapTotal:           0 kB
SwapFree:            0 kB</pre></td>
</tr>

</table>

<a name="small">
<h3>Simple graph</h3>
</a>

<p>
In the first example we try to measure the overhead of loading
the program. We do render a very small graph, consisting of only
two nodes, connected by one edge. Shown below is the input to
<code>examples/as_ascii</code> and <code>dot</code>.
</p>

<pre class="graphtext">
graph { autolink: name; }
[ Bonn ] -> [ Berlin ]
</pre>

<pre class="graphtext">
digraph GRAPH_0 {

  // Generated by Graph::Easy 0.29 at Fri Sep  9 23:14:05 2005

  edge [ arrowhead=open ];
  graph [ rankdir=LR ];
  node [
    fontsize=11,
    fillcolor=white,
    style=filled,
    shape=box ];

  Berlin [ URL="/wiki/index.php/Berlin" ]
  Bonn [ URL="/wiki/index.php/Bonn" ]

  Bonn -> Berlin

}
</pre>

<div class="clear"></div>

<p>
Note that the graph contains two links for the nodes. By default,
<code>dot</code> would only produce a PNG image, so we also need
to call it so that it constructs an image map which can be used
to link the individual nodes to their targets.
<br>
Since the extension responsible for converting the graph input
to the appropriate image+map does not know whether there
are links or not, it will typically try to create the



( run in 1.377 second using v1.01-cache-2.11-cpan-39bf76dae61 )