Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Python Performance Tips
Index -> Programming, Python -> Python Tutorials
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
apython1992




PostPosted: Mon Mar 21, 2011 12:30 pm   Post subject: Python Performance Tips

In another topic on these forums a few members started wondering which looping techniques in Python result in the fastest execution, and I was pretty curious about the verdict - you can use mapping, list comprehensions, explicit for loops, and others too. I found this resource on the web that documents an in-depth study on this matter:
http://www.python.org/doc/essays/list2str.html

If you're looking for ways to make your code much faster, take a look at that study. I find it incredibly useful. Also, since there's obviously more to optimizing code than just figuring out the best looping constructs, I found a page written by some of the Python guys themselves detailing a number of tips on writing the most efficient code, exploring other issues like dots, sorting, local variables, and more. I feel like this would be a really handy resource for Pythoneers who are worried about writing high-performance code:
http://wiki.python.org/moin/PythonSpeed/PerformanceTips

Happy optimizing!
Sponsor
Sponsor
Sponsor
sponsor
SNIPERDUDE




PostPosted: Mon Mar 21, 2011 1:41 pm   Post subject: RE:Python Performance Tips

Thanks for the links!
apython1992




PostPosted: Mon Mar 21, 2011 1:52 pm   Post subject: RE:Python Performance Tips

You're quite welcome!
Display posts from previous:   
   Index -> Programming, Python -> Python Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: