(转)如何使用Psyco为你的Python程序提速。
来源:互联网 发布:html5网站模板源码 编辑:程序博客网 时间:2024/06/06 03:45
psyco加速Python执行速度的方法:
要求:
版本对照:
File name Python versions Well-tested with
psyco-x.y-win32-py2.2.2.exe 2.2.2 and up 2.2.2 and 2.2.3
psyco-x.y-win32-py2.3.exe 2.3 and up 2.3 and 2.3.3
psyco-x.y-win32-py2.4.exe 2.4 and up 2.4.*
psyco-x.y-win32-py2.5.exe 2.5 and up 2.4
操作系统,CPU的限制:
# A 32-bit architecture. A Pentium or any other Intel 386 compatible processor is recommended.
# Linux, Mac OS/X, Windows, BSD are known to work.
# A regular Python installation, version 2.2.2 or up. Psyco is not a replacement for the Python interpreter and
libraries, it works on top of them.
使用psyco
import psyco
psyco.full()#对所有函数用psyco进行编译
psyco.bind(myfunction1)#对选中的函数用psyco进行编译
g = psyco.proxy(f) #对函数f用psyco进行编译
g(args) # Psyco-accelerated call 编译后g函数速度会有提升
f(args) # regular slow call f函数保持原来的调用速度
psyco.log # 用来记录日志 Enable logging to a file named xxx.log-psyco by default, where xxx is the name of the
script you ran.
psyco.profile() # 可以替代psyco.ful()
psyco.log()
psyco.full(memory=100) #参数是什么意思没看懂。
psyco.profile(0.05, memory=100)#0.05,memeoy=100 参数也没看懂。
psyco.profile(0.2)
参考:http://psyco.sourceforge.net/psycoguide/index.html psyco的使用说明书。
转载自 :http://biansutao.iteye.com/blog/352394
- (转)如何使用Psyco为你的Python程序提速。
- 使用psyco来加速python程序
- 提速,提速,程序的提速
- 利用 psyco 让 Python 程序执行更快
- 利用 psyco 让 Python 程序执行更快
- 利用 psyco 让 Python 程序执行更快
- 利用Psyco让Python程序执行更快
- 使用Protocol Buffers的C语言拓展提速Python程序的示例
- 如何为你的程序添加进度条
- 如何为大型网站提速
- 程序提速的方法
- [转]为 PHP 应用提速、提速、再提速!,第 1 部分: 使用操作码缓存软件提升性能和吞吐量
- [转]为 PHP 应用提速、提速、再提速!,第 1 部分: 使用操作码缓存软件提升性能和吞吐量
- [转]为 PHP 应用提速、提速、再提速!,第 1 部分: 使用操作码缓存软件提升性能和吞吐量
- 如何使用Python为Hadoop编写一个简单的MapReduce程序
- 如何使用Python为Hadoop编写一个简单的MapReduce程序
- 如何使用Python为Hadoop编写一个简单的MapReduce程序
- 你的网站为什么会慢?——用YSlow为你的网站提速
- py2exe笔记
- 分治算法 最接近点对(一维)
- python round(x)函数
- windows平台下如何用Python杀进程
- Python模块subprocess小记
- (转)如何使用Psyco为你的Python程序提速。
- python删除非空目录的方法
- Linux的cron和crontab
- sphinx启动searchd服务时,报segmentation fault (段错误)
- HDU_1175 连连看(BFS)
- (转载)谈CRC32碰撞的概率和可能性
- 万物互联,服务万家
- Tokyo Tyrant(ttserver)在大数据量下的不稳定案例
- Django 性能测试——一个现实世界的例子