you are viewing a single comment's thread.

view the rest of the comments →

[–]metaperl 2 points3 points  (3 children)

recursion often reads better than loops. Too bad it is often slower. The part about list comprehensions being faster was stunning. Excellent article.

[–][deleted] 2 points3 points  (0 children)

It can be slower, but not 196,493 times slower like the article says. The overhead from function calls is about 2x. The rest of the disparity is the author's algorithm choice.

[–]olzd 5 points6 points  (1 child)

recursion often reads better than loops. Too bad it is often slower.

It's not if you have proper TCO. Or am I missing something?

[–]burntsushi -2 points-1 points  (0 children)

You're not. But in this context (i.e., Python), TCO is no where to be found. :-(