A guide to analyzing Python performance

链接

一篇 Python 性能分析方面的好文,介绍了分别用 unix time命令和 context manager 来粗略/精细地测试 Python 脚本的运行时间; 使用 line_profiler 库 精细衡量每行代码的执行时间; 使用 memory_profiler 库测试内存使用情况; 使用 objgraph 库检测内存泄漏 ...