Python比的Java / C#慢? [英] Is Python slower than Java/C#?

查看:206
本文介绍了Python比的Java / C#慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python比的Java / C#慢?

Is Python slower than Java/C#?

<一个href=\"http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/\">performance-comparison-c-java-python-ruby-jython-jruby-groovy

下面是优化CPython的一个项目:空载吞咽

Here is a project that optimizes CPython: unladen-swallow

推荐答案

不要混为一谈语言和运行时间。

Don't conflate Language and Run-Time.

的Python(语言)有许多运行时实现。

Python (the language) has many run-time implementations.


  • CPython的是PTED通常跨$ P $,并且会比native- code C#慢。它可能是比Java慢,这取决于Java JIT编译器

  • CPython is usually interpreted, and will be slower than native-code C#. It might be slower than Java, depending on the Java JIT compiler.

Jython是在JVM PTED间$ P $,并且具有相同的性能配置和Java。

JYthon is interpreted in the JVM and has the same performance profile as Java.

IronPython的是依赖于相同的.NET库和IL为C#,所以性能差异会比较小。

IronPython is relies on the same .NET libraries and IL as C#, so the performance difference will be relatively small.

Python可以通过耐热玻璃,PyToC,和其他被转换为本地code。在这种情况下,它通常会执行以及C ++。你可以 - 在一定程度上 - 进一步优化C ++也许排挤不是从高硼硅未优化的输出一点点更好的性能。

Python can be translated to native code via PyREX, PyToC, and others. In this case, it will generally perform as well as C++. You can -- to an extent -- further optimize C++ and perhaps squeeze out a little bit better performance than unoptimized output from PyREX.

有关详细信息,请参阅http://arcriley.blogspot.com/2009/03/so-long-pyrex.html

请注意了Python(语言)是不慢。一些Python运行时间(CPython的,例如)会比native- code C ++慢。

Note that Python (the language) is not slow. Some Python run-times (CPython, for example) will be slower than native-code C++.

这篇关于Python比的Java / C#慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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