python 性能测试

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

 

用例测试
 
test.py 文件:
 
 

 

posted @ 2019-07-06 14:22  大步向前blue  阅读(782)  评论(0编辑  收藏  举报