python_性能分析profile
来源:互联网 发布:增强现实软件 编辑:程序博客网 时间:2024/05/22 14:43
如果希望对程序进行优化,那么性能分析是必不可少的。标准库中包含了一个叫profile的模块,使用起来非常简单
import profile, my_mathprofile.run('my_math.square(100)')只需要运行该模块的run方法,(需要注意的是参数为字符串。)即可得到如下结果:
4 function calls in 0.001 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.001 0.001 0.001 0.001 :0(setprofile)
1 0.000 0.000 0.000 0.000 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 my_math.py:3(square)
1 0.000 0.000 0.001 0.001 profile:0(my_math.square(100))
0 0.000 0.000 profile:0(profiler)
其中my_math.py中内容为
def square(x): return x**2
Process finished with exit code 0
0 0
- python_性能分析profile
- VS2010 Profile性能分析
- show profile 分析性能
- Python Profile 工具性能分析
- [转]Python Profile 工具性能分析
- MySQL性能分析工具profile使用教程
- 性能分析工具firebug.console.profile(title)
- D Profile 开源性能分析工具
- mysql使用profile分析语句性能消耗
- MySQL性能分析工具profile使用教程
- VS2015性能分析工具Performance Profile
- mysql性能分析工具--show profile
- 【性能分析】初探VS2010中的Profile(性能剖析)功能
- 【性能分析】初探VS2010中的Profile(性能剖析)功能
- Python_主成分分析
- mysql查询性能分析(show status,show profile,explain)
- android性能分析工具Profile GPU rendering详细介绍
- 利用firebug的console.profile分析js代码性能
- 你未必知道的css小知识
- Linux查看磁盘分区文件系统与使用情况
- 特殊的日子(2015年5月1日劳动节)纪念回归和新的征程,用LRU和LFU两个小算法原理和区别来抛砖引玉
- 一些常用的html/CSS效果---小技巧
- 解决float浮动带来的父元素高度没有的问题---清除浮动
- python_性能分析profile
- [OC学习笔记]NSArray、NSMutableArray、NSValue方法
- Linux查看内存大小
- CSS分页
- Win10设计主管告诉你改变了什么(以及没有改变的)
- 高级Java程序员值得拥有的10本书
- C# webservice相关操作
- Linux查看目前登入系统的用户信息
- apache启动报错(98)Address already in use: make_sock: could not bind to address [::]:80