python 性能测试

        python中使用的性能测试模块是memory_profiler , 我们使用它里面的profile这个装饰器即可测试出我们的代码的内存使用情况了。
 
如果没有安装 memory_profiler 则使用pip 安装一下即可,我用的是python3.7的版本安装命令:
 
 
pip3 install memory_profiler
用例测试
 
test.py 文件:
 
 

猜你喜欢

转载自www.cnblogs.com/yinguohai/p/11142603.html