Calling `ForEachNode` hits the DB, and allocates and parses every node in the graph. Walking the channels also loads nodes from the DB, so this meant that each node was read/parsed/allocated several times per run. This reduces runtime by ~10ms and memory usage by ~4mb.
routing
The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/routing