CPython和IronPython的功能差异

2024-09-28 18:51:16 发布

您现在位置:Python中文网/ 问答频道 /正文

根据我的理解,IronPython被编译成字节码,字节码通过.NETCLR编译成machinecode,而CPython被编译成字节码并用PVM进行解释。这是真的吗?CLR到底是什么?它也是一个虚拟机吗? 这是否意味着铁蟒更快? 我希望有人能给我解释一下。在


Tags: 字节cpythonironpython编译成clrpvm铁蟒netclr
1条回答
网友
1楼 · 发布于 2024-09-28 18:51:16

IronPython编译为Microsoft中间语言(MSIL),它类似于由CPython生成和解释的字节码。公共语言运行库(CLR)是执行MSIL的虚拟机。它有一个实时(just-in-time,JIT)编译器,可以将MSIL转换为本机代码。在

CPython没有JIT。The IronPython wiki关于性能有这样的说法:

Performance is comparable to CPython - much faster for some things (where it can take advantage of the JIT compiler in the underlying platform), but slower for other things (particularly the built in container types where a lot of work has been done on optimising the CPython types).

相关问题 更多 >