2 Extracting maximum performance from built-in features

This chapter covers

  • Profiling code to find speed and memory bottlenecks
  • Making more efficient use of existing Python data structures
  • Understanding Python’s memory cost of allocating typical data structures
  • Using lazy programming techniques to process large amounts of data

There are many tools and libraries to help us write more efficient Python. But before we dive into all the external options to improve performance, let’s first take a closer look at how we can write pure Python code that is more efficient, in both computing and IO performance. Indeed many, although certainly not all, Python performance problems can be solved by being more mindful of Python’s limits and capabilities. ...

Get Fast Python 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.