As I said on IRC, recursion seems slightly faster as tested with https://gist.github.com/matham/9295694. Except when we hit the max recursion depth.

And to repeat, the reason for adding both walkup and loopback to the function parameter list is that in the code you posted, you conflated loopback with walking up. loopback is when we reach the very last element, whether we start back from the tree root. walking up is whether we are allowed to walk up the parent tree from our current level. For recursion to work, there needs to be a walkup parameter, but we also need a loopback parameter for users.

So I guess this means that the recursive path is preferred?