arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1306.6047cs.PL
收藏

我们可以多快地实现解释型Python?

How fast can we make interpreted Python?

Russell Power, Alex Rubinsteyn

摘要:

Python是一种流行的动态语言,其吸引力很大一部分来自强大的库和扩展模块。这些都增强了语言,使其成为一个高效的环境,可以执行各种任务,从Web开发(Django)到数值分析(NumPy)。不幸的是,与Lua和JavaScript等语言的现代实现相比,Python的性能相当差。为什么Python远远落后于其他语言?正如我们所展示的,使Python成为强大语言的API和扩展库也使其难以有效执行。考虑到我们希望保留对已经存在的Python扩展库的访问,我们可以多快做到这一点?为了评估这一点,我们设计并实现了Falcon,一个与标准CPython解释器完全兼容的高性能字节码解释器。Falcon应用了许多众所周知的优化,并引入了几种新技术来加速Python字节码的执行。在我们的评估中,我们发现Falcon在大多数基准测试中比标准Python解释器平均快25%,在某些情况下快2.5倍。

英文摘要:

Python is a popular dynamic language with a large part of its appeal coming from powerful libraries and extension modules. These augment the language and make it a productive environment for a wide variety of tasks, ranging from web development (Django) to numerical analysis (NumPy). Unfortunately, Python's performance is quite poor when compared to modern implementations of languages such as Lua and JavaScript. Why does Python lag so far behind these other languages? As we show, the very same API and extension libraries that make Python a powerful language also make it very difficult to efficiently execute. Given that we want to retain access to the great extension libraries that already exist for Python, how fast can we make it? To evaluate this, we designed and implemented Falcon, a high-performance bytecode interpreter fully compatible with the standard CPython interpreter. Falcon applies a number of well known optimizations and introduces several new techniques to speed up execution of Python bytecode. In our evaluation, we found Falcon an average of 25% faster than the standard Python interpreter on most benchmarks and in some cases about 2.5X faster.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑