aysylu/loom — pull request #23 by gdevanla (2014-04-26 13:14:24+00:00)
Title: speed up traverse-all, scc

Fixes #5

Changes:

traverse-all : This method was creating new persistent list after each call to pre or post traverse. Since this list is local to the function, we can change it to transient. This speeds up any call to post-traverse/pre-traverse.

scc : Change the internal scc list to transient. Also, the remove from stack was linear operation called for almost every node. Just letting the recur loop remove the item from the stack gave a considerable performance boost.

Now, with this change pre-traverser, post-traverse, and scc all return in ~14 sec on my machine. Earlier, it was taking more than 5 minutes.