Accumulating a graph “descriptor” in a monoid and then imperatively converting it into a graph may account for some of the current performance overhead. It may be worth just using the ST monad to build the graph directly, forgoing the intermediate data structure.
Accumulating a graph “descriptor” in a monoid and then imperatively converting it into a graph may account for some of the current performance overhead. It may be worth just using the
ST
monad to build the graph directly, forgoing the intermediate data structure.