Python论坛  - 讨论区

标题:[python-chinese] 让你的 python 代码奔跑如飞

2005年12月06日 星期二 22:45

prolibertine prolibertine at gmail.com
Tue Dec 6 22:45:42 HKT 2005

http://psyco.sourceforge.net/introduction.html

[quote]
Psyco is a specializing compiler. In a few words let us first see:

What you can do with it

In short: run your existing Python software much faster, with no change
in your source.

Think of Psyco as a kind of just-in-time (JIT) compiler, a little bit
like what exists for other languages, that emit machine code on the fly
instead of interpreting your Python program step by step. The
difference with the traditional approach to JIT compilers is that Psyco
writes several version of the same blocks (a block is a bit of a
function), which are optimized by being specialized to some kinds of
variables (a "kind" can mean a type, but it is more general). The
result is that your unmodified Python programs run faster.

Benefits

    2x to 100x speed-ups, typically 4x, with an unmodified Python
interpreter and unmodified source code, just a dynamically loadable C
extension module.
[/quote]


--
/**********************************************************
* Love in Gentoo-Linux  C and Python
* Look at my website and my blog
* http://www.jnlinux.org
* http://bbs.jnlinux.org
**********************************************************/

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 10:07

Bruce Who bruce.who.hk at gmail.com
Wed Dec 7 10:07:56 HKT 2005

以前就用过了,并没有明显的感觉,而且加大了内存占用。呵呵,其实以现在电脑的配置,运行一般的python脚本本来就是奔跑如飞。

On 12/6/05, prolibertine <prolibertine at gmail.com> wrote:
> http://psyco.sourceforge.net/introduction.html
>
> [quote]
> Psyco is a specializing compiler. In a few words let us first see:
>
> What you can do with it
>
> In short: run your existing Python software much faster, with no change
> in your source.
>
> Think of Psyco as a kind of just-in-time (JIT) compiler, a little bit
> like what exists for other languages, that emit machine code on the fly
> instead of interpreting your Python program step by step. The
> difference with the traditional approach to JIT compilers is that Psyco
> writes several version of the same blocks (a block is a bit of a
> function), which are optimized by being specialized to some kinds of
> variables (a "kind" can mean a type, but it is more general). The
> result is that your unmodified Python programs run faster.
>
> Benefits
>
>    2x to 100x speed-ups, typically 4x, with an unmodified Python
> interpreter and unmodified source code, just a dynamically loadable C
> extension module.
> [/quote]
>
>
> --
> /**********************************************************
> * Love in Gentoo-Linux  C and Python
> * Look at my website and my blog
> * http://www.jnlinux.org
> * http://bbs.jnlinux.org
> **********************************************************/
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 10:16

prolibertine prolibertine at gmail.com
Wed Dec 7 10:16:04 HKT 2005

在 05-12-7,Bruce Who<bruce.who.hk at gmail.com> 写道:
> 以前就用过了,并没有明显的感觉,而且加大了内存占用。呵呵,其实以现在电脑的配置,运行一般的python脚本本来就是奔跑如飞。
>
有这种感觉,运行的python速度不错,起码比java得快很多

--
/**********************************************************
* Love in Gentoo-Linux  C and Python
* Look at my website and my blog
* http://www.jnlinux.org
* http://bbs.jnlinux.org
**********************************************************/

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 11:54

林杰杰 linsoso at gmail.com
Wed Dec 7 11:54:19 HKT 2005

哈哈,处理的问题不是很大,所以用Python也不显慢。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20051207/74ddefb3/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 12:55

july july july.lzu at gmail.com
Wed Dec 7 12:55:34 HKT 2005

我用python + psyco写过TSP和neural
network的程序,感觉前几次运行有对速度有明显改善,后来慢慢变慢了。没和java比过,不知道java怎么样。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20051207/7311ead3/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 13:29

Liu Jun gz19990909 at 163.com
Wed Dec 7 13:29:39 HKT 2005

你好,July
我想问一下你所指的TSR是什么?内存驻留程序吗?运行速度和内存占用情况怎么
样?因为我也想用python写一个管理日程的小程序,就怕它常驻内存的话会占用太
多的内存和CPU。


july july 写道:

> 我用python + psyco写过TSP和neural network的程序,感觉前几次运行有对速
> 度有明显改善,后来慢慢变慢了。没和java比过,不知道java怎么样。
>
>------------------------------------------------------------------------
>
>_______________________________________________
>python-chinese
>Post: send python-chinese at lists.python.cn
>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 13:32

超卓 chaoszhuo at gmail.com
Wed Dec 7 13:32:44 HKT 2005

我试了一个程序,使用profile()时区别不大,但是用full()时开始编译的时间比较长,但运行的速度明显快了很多

Chaos


在05-12-7,july july <july.lzu at gmail.com> 写道:
>
> 我用python + psyco写过TSP和neural
> network的程序,感觉前几次运行有对速度有明显改善,后来慢慢变慢了。没和java比过,不知道java怎么样。
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20051207/57c8ceb9/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月07日 星期三 18:38

ONE_Fox onefox.fox at gmail.com
Wed Dec 7 18:38:30 HKT 2005

Python 2.4 跟 Java 1.5,速度差距是可以直接体会到的

我正在做一个Java程序的 Python 化, 同样代码的操作

Python 似乎要比 Java 慢一点点

也就一点点,因为java也快不到哪儿去 呵呵
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20051207/e0184c6d/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年12月08日 星期四 00:10

saddle saddle at gmail.com
Thu Dec 8 00:10:32 HKT 2005

我猜,和neural network 一块出现的TSP是指 旅行商问题 了。
在 05-12-7,Liu Jun<gz19990909 at 163.com> 写道:
> 你好,July
> 我想问一下你所指的TSR是什么?内存驻留程序吗?运行速度和内存占用情况怎么
> 样?因为我也想用python写一个管理日程的小程序,就怕它常驻内存的话会占用太
> 多的内存和CPU。
>
>
> july july 写道:
>
> > 我用python + psyco写过TSP和neural network的程序,感觉前几次运行有对速
> > 度有明显改善,后来慢慢变慢了。没和java比过,不知道java怎么样。
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >python-chinese
> >Post: send python-chinese at lists.python.cn
> >Subscribe: send subscribe to python-chinese-request at lists.python.cn
> >Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> >Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号