Do you want to optimize the performance of your Python program to make it run faster or consume less memory? Before diving into any performance tuning, you should strongly consider using a technique called software profiling. It can help you decide whether optimizing the code is necessary and, if so, which parts of the code you should focus on.
Sometimes, the return on investment in performance optimizations just isn’t worth the effort. If you only run your code once or twice, or if it takes longer to improve the code than execute it, then what’s the point?
When it comes to improving the quality of your code, you’ll probably optimize for performance as a final step, if you do it at all. Often, your code will become speedier and more memory efficient thanks to other changes that you make. When in doubt, go through this short checklist to figure out whether to work on performance:
- Testing: Have you tested your code to prove that it works as expected and without errors?
- Refactoring: Does your code need some cleanup to become more maintainable and Pythonic?
- Profiling: Have you identified the most inefficient parts of your code?
What’s Included:
- 8 Lessons
- Video Subtitles and Full Transcripts
- 3 Downloadable Resources
- Accompanying Text-Based Tutorial
- Q&A With Python Experts: Ask a Question
- Certificate of Completion
Downloadable Resources:
Related Learning Paths: