On 5 Sep, 08:47, Steven D'Aprano <st...@remove-this- cybersource.com.au> wrote:
> How do you know? After more than 10 years experience with scientific programming I just do. When it comes to numerics I have a gut feeling for what is fast and what is slow. It's not difficult actually. You just have to imagine how often the interpreter is invoked. Explicit loops are therefore evilness in numerical scripts. Vectorized array expressions tend to be comparable to C in performance, because they do a lot of work independent of the interpreter. What do we see here? Vectorized array expressions throughout the code, no significant amount of looping by the interpreter (just the recursion at the end). -- http://mail.python.org/mailman/listinfo/python-list