For that kind of traversing, you can unroll the recursivity, but i'm not sure about the comprehension / maintenance. For performance, i guess you could try to do a simple benchmark :) (just for fun)