Antoine Pitrou <pit...@free.fr> added the comment: > I was a little worried about the performance impact, so I did some > trivial benchmarks: > - O(depth) fwalk() is actually a tiny bit faster than walk() (it may > be because we don't do as much path lookup) > - O(1) fwalk() is around 20% slower, on a pure-traversal benchmark (so > in a realistic use case where we would actually do something with the > values returned by fwalk() the difference shouldn't be that > noticeable)
I think the O(depth) version is fine. The O(1) version is quite more complicated, difficult to follow, and it seems less robust (it doesn't use try/finally and therefore might leak fds if the generator isn't exhausted before being destroyed). On modern systems you have at least 1024 fds, so the restriction shouldn't be a problem. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13734> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com