What problem does it solve? Slow Python code and hidden memory leaks waste compute resources and degrade user experience, but finding the real bottleneck without proper profiling is guesswork. This Skill provides a systematic workflow for measuring, diagnosing, and fixing CPU, memory, and I/O performance issues in Python applications. ## Core Features & Use Cases - CPU and Line Profiling: Use cProfile, line_profiler, and py-spy to identify time-consuming functions at function-level or line-level granularity, including live production processes. - Memory Optimization: Track allocations with memory_profiler and tracemalloc, detect leaks, and reduce footprint with generators, slots, and weak references. - Optimization Patterns: Apply proven techniques such as list comprehensions, dict lookups, lru_cache, NumPy vectorization, multiprocessing for CPU-bound work, and async I/O for network-bound tasks. - Use Case: A data pipeline takes 40 minutes to run. Profile it with cProfile to find a hot loop, replace list searches with dict lookups, vectorize numeric work with NumPy, and benchmark the improvement with timeit. ## Quick Start Profile my Python script with cProfile, identify the slowest functions, and suggest concrete optimizations with benchmark comparisons.