need for speed

Michael Rybak accepted at ukr.net
Mon Aug 1 13:14:51 EDT 2005


SDA> On Mon, 01 Aug 2005 02:28:36 -0700, borges2003xx at yahoo.it wrote:

>> hi everyone
>> can someone suggest me where find a lot programming tricks for
>> achieving the top speed in python?

SDA> There is only one programming trick you need to know about making code run
SDA> fast.

SDA> Never even waste one second on optimising code before it is working,
SDA> or before you have tested it and profiled it and know (1) that it IS slow;
SDA> and (2) WHERE it is slow.

SDA> Why would you waste your valuable time making bugs run faster? Why waste
SDA> time and effort to speed up something that is already fast enough?

SDA> In other words: Make your code work. Make it work right. Then, and only
SDA> then, make it run fast -- and only if it isn't already fast.

SDA> Now that you have written your code, and you have made it work right,
SDA> please tell us what the code is, and the results of profiling the code,
SDA> and we will help you speed it up.


Is there a way of profiling other than manual (debug output with
measurements and all)? Some tools? And is there some kind of plugin
for native Python's IDLE to trace scripts? I'm a bit tired of getting
all info from debug output and exceptions

SDA> -- 
SDA> Steven



-- 
Best Regards,
 Michael Rybak                       mailto:accepted at ukr.net




More information about the Python-list mailing list