Python Perf Optimization

Systematic workflow for optimizing a Python project's runtime performance, memory footprint, or startup time. Use whenever the user asks to make Python code faster, reduce memory usage, profile a Python project, fix slow tests/CI, or generally "optimize" a Python codebase. Always measure before and after changes — never optimize on vibes. Covers profiling (cProfile, py-spy, memray, line_profiler), algorithmic fixes, C-extension/native acceleration (Cython, Numba, Rust via PyO3), concurrency (asyncio, multiprocessing, GIL/free-threading), memory optimization (__slots__, generators, numpy), and packaging/startup optimization.

daedalus 06e47b5 18.5 KB Updated

File contents

daedalus/skills/tree/main/skills/python-perf-optimization commit 06e47b5106

Frequently asked questions

npx skillmds@latest add daedalus/python-perf-optimization