Python Performance Optimization

当 Python 应用变慢、CPU/内存吃紧、需要在优化前定位真实瓶颈时使用;先用 cProfile/line_profiler/memory_profiler/py-spy 剖析热点,再按算法→数据结构→缓存→向量化→并行的次序优化并做前后基准对比;不适用于功能正确性 bug、非 Python 代码或线上分布式链路追踪;触发词:Python 性能、cProfile、py-spy、lru_cache、内存泄漏、慢。

findscripter f85a1be 5.8 KB Updated

File contents

findscripter/everything-skills/tree/main/02-engineering/python-performance-optimization commit f85a1beda7

Frequently asked questions

npx skillmds@latest add findscripter/python-performance-optimization