Chapter 8. Improving Performance – Part One

Let's recap what you learned in the previous chapter. We started with a program that appeared harmless until some parameters were tweaked. This change revealed performance issues. Hence, we performed a search operation (profiling) to catch the culprits (the bottlenecks). Now, let's see what we can do to speed up the application code. To be specific, we will cover the following topics:

  • Cutting down the runtime of the Gold Hunt application
  • Learning to improve the application performance using the following ways:
    • Making changes to the algorithm
    • Avoiding the function re-evaluation
    • Using the list and dictionary comprehensions
    • Using generator expressions
    • Using tricks to improve the performance of code involving loops ...

Get Learning Python Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.