Table of Contents
Preface
Section 1: Python-Native and Specialized Optimization
Chapter 1: Benchmarking and Profiling
Technical requirements
Designing your application
Building a particle simulator
Visualizing the simulation
Writing tests and benchmarks
Timing your benchmark
Writing better tests and benchmarks with pytest-benchmark
Finding bottlenecks with cProfile
Graphically analyzing profiling results
Profiling line by line with line_profiler
Optimizing our code
Using the dis module
Profiling memory usage with memory_profiler
Summary
Questions
Further reading
Chapter 2: Pure Python Optimizations
Technical requirements
Using the right algorithms and data structures
Lists and deques
Dictionaries
Sets
Heaps
Tries
Improved efficiency with caching ...
Get Advanced Python Programming - Second Edition 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.