Prompts-MCP 686 skills · ai / design / design-pattern / framework / fundamentals / habit / lang / tech-selection /mcp/sse
lang lang/python/performance/index.md medium

lang-python-performance-index

Python 性能与并发优化(profiling / 缓存分层 / 并发模型选型 / 子解释器与 JIT 前沿)。Use when 优化热点 / 选并发模型 / 加缓存 / 评估 free-threading。

子项索引

子项 一句话
profiling skill Python 性能剖析工具选型 — cProfile/timeit/line_profiler/py-spy/memray
caching-strategy skill Python 缓存分层 — lru_cache/cache 进程内缓存 + cached_property + Redis 跨进程分层
process-vs-thread-vs-async skill Python 并发模型选型 — CPU 密集走多进程、I/O 密集走 async、阻塞库走线程,及 free-threading 影响
subinterpreters-jit skill Python 前沿运行时 — 子解释器(PEP 734)、JIT(PEP 744)、specializing interpreter 定位与取舍

Python · 性能与并发优化

进阶维度:先量化、再选型、最后才上前沿特性。不要凭直觉优化。

下钻决策表

你在做什么 进哪个
代码慢但不知慢在哪 profiling
重复计算 / 重复查库想加缓存 caching-strategy
CPU 密集 vs I/O 密集选并发模型 process-vs-thread-vs-async
评估 3.13/3.14 子解释器、JIT、free-threading subinterpreters-jit

链接