This walks you through the essential Python profiling toolkit, from cProfile for CPU bottlenecks to memory_profiler for tracking allocations and py-spy for production debugging. You'll learn to identify slow functions, optimize list comprehensions versus loops, fix string concatenation performance, and choose the right data structures. The patterns cover real optimization wins like switching from O(n) list searches to O(1) dictionary lookups, using generators to reduce memory usage, and leveraging local variables over globals. Solid for debugging sluggish applications or optimizing data processing pipelines before they hit production.
npx skills add https://github.com/wshobson/agents --skill python-performance-optimization