How can I make this piece of code even faster?
torriem at gmail.com
Sun Jul 21 17:27:36 CEST 2013
On 07/21/2013 04:19 AM, pablobarhamalzas at gmail.com wrote:
> Thank's for all the replies! I've tried some of the imporovements you suggested (using math.exp() and sum() or math.fsum()).
> None of that made the code faster, because they are functions you are calling lots of times, and function calling is quite time expensive (same as x**(1/2) is faster than math.sqrt(x)).
> I'm going to try to convert tu numpy now (I have no idea how to do it at the moment), thank's again to everyone.
Perhaps you'd have better results if you'd post a runnable piece of
code. Otherwise we're just guessing since no one has the ability to
actually run your code.
More information about the Python-list