与C相比,python是否非常慢 [英] Is python very slow compared to C

查看:97
本文介绍了与C相比,python是否非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习python。有人说它很慢。可以

有人指出这个问题。


Thans

I have just started to learn python. Some said that its slow. Can
somebody pin point the issue.

Thans

推荐答案

di********@gmail.com 写道:
我刚开始学习python。有人说它很慢。可以有人指出这个问题。
I have just started to learn python. Some said that its slow. Can
somebody pin point the issue.




这取决于你在做什么。很多Python都只包装了C.所以

很多东西都很快。



It depends on what you are doing. Much of Python is just wrapped C. So
many things are very fast.


与C相比,大多数语言都很慢。对于你想用它做的任何事情,Python都足够快。


罗伯特

Most languages are slow compared to "C". Python is fast enough for just
about anything you want to do with it.

Robert


是的,这种语言很慢,但经常这不是问题,

,因为你使用的是用C编写的快速函数/库,或者你是

进行I / O绑定操作。而Psyco,数字/ numarray,ShedSkin可以在其他一些情况下帮助
(Pyrex和其他解决方案允许你混合使用
低级语言)。如果您正在寻找纯粹的算法速度

,您可能需要去寻找其他语言,如C,C ++,Ocaml,

类型的Lisp代码等。


再见,

。熊市

Yes this language is very slow, but frequently this isn''t a problem,
because you are using fast functions/libraries written in C, or you are
doing I/O bound operations. And Psyco, numeric/numarray, ShedSkin can
help in some other cases (Pyrex and other solutions allow you to mix in
lower level languages). If you are looking for pure algorithmic speed
you probably have to go look for other languages, like C, C++, Ocaml,
typed Lisp code, etc.

Bye,
bearophile


这篇关于与C相比,python是否非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆