Practical Profiling
summary
Demonstrates concrete tools and results: use cProfile to write result.profile files, load them with pstats.Stats and sort by cumulative time, use memory_profiler and line_profiler for per-line memory/time. Shows a comprehension vs for-loop case that runs ~0.09s versus ~0.19s (roughly double). Argues for running profiles against integration tests, saving profile files and git SHAs so results are reproducible and comparable over time, and reports that few real projects actually store or track profiling outputs.
AI-written summary · about
chapters (16)
- 0:00Intro
- 1:10Profiling
- 1:50Development
- 2:50Team Environment
- 3:20User Perspective
- 5:25The Tools
- 6:05Memory Profiler
- 7:00See Profile
- 9:20Implementation
- 12:10Search Results
- 13:20Snug
- 14:25One Laptop Per Child
- 14:55Katie Cross
- 16:20Canonical
- 17:30Code Speed
- 19:35Audience QA
related talks
24mOff road profiling - when the automated profilers just don't cut it.
01h 31mDebugging and profiling techniques
02h 33mMeasure, don't Guess - How to find out if and where to optimize
37mTuning Python applications can dramatically increase performance
32mProfiling at the speed of light
22mExperiences making CPU-bound tasks run much faster
30mHow to Tune your Python Analysis Pipeline: A Profiler Guide
30mWrite faster Python! Common performance anti patterns
