为什么IronPython比官方Python解释器快 [英] Why is IronPython faster than the Official Python Interpreter

查看:59
本文介绍了为什么IronPython比官方Python解释器快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据此:

http://www.codeplex. com/IronPython/Wiki/View.aspx?title = IP20VsCPy25Perf& referringTitle = IronPython%20Performance

IronPython(适用于.Net的Python)比同一台计算机上的常规Python(cPython)要快.为什么是这样?我认为编译后的C代码总是比等效的CLI字节码更快.

IronPython (Python for .Net) is faster than regular Python (cPython) on the same machine. Why is this? I would think compiled C code would always be faster than the equivalent CLI bytecode.

推荐答案

Python代码无法编译为C,Python本身是用C编写的,并且可以解释Python字节码. CIL被编译为机器代码,这就是为什么在使用IronPython时会看到更好的性能的原因.

Python code doesn't get compiled to C, Python itself is written in C and interprets Python bytecode. CIL gets compiled to machine code, which is why you see better performance when using IronPython.

这篇关于为什么IronPython比官方Python解释器快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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