Measure, don't Guess - How to find out if and where to optimize
summary
The claim is: measure before you change anything and use real experiments to decide where to spend time. Examples, scripts and notebooks use cProfile, line_profiler, memory_profiler and SnakeViz (plus the pyStones benchmark) to produce concrete numbers — e.g. ~71k pyStones, a sleep example showing ~0.1s CPU vs 10s wall time, and list append behavior where 10M appends produce only ~104 allocations. The material includes reusable decorators and visualizers (sunburst/icicle) that work but require careful timer and OS-aware interpretation.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 10:25Optimization in Python
- 28:54Python performance with pybench
- 31:29CPU profiling with cProfile
- 54:23Wall clock vs CPU time
- 1:02:34Visualizing profiling results
- 1:17:55Line-by-line profiling
- 1:29:12Memory profiling with pympler
- 1:47:55Memory growth patterns
- 2:08:03Python performance anti-patterns
- 2:24:17Optimization strategies
- 2:32:00Q&A








