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

Python翻译器在多线程CPU绑定应用程序中的性能比较

Performance Comparison of Python Translators for a Multi-threaded CPU-bound Application

Andrés Milla, Enzo Rucci

摘要:

目前,Python是各种应用领域中使用最广泛的语言之一。然而,由于其官方CPython解释器的性质,它在优化和并行化应用程序时有局限性,特别是对于CPU受限的应用程序。为了解决这个问题,出现了几种替代翻译器,每种都有不同的方法和自己的性价比。由于缺乏比较研究,我们使用N-Body作为案例研究(一个众所周知的高计算需求问题)对这些翻译器进行了性能比较。结果表明,CPython和PyPy在并行化算法方面由于其局限性而表现不佳;而Numba和Cython则表现出更高的性能,证明是加速数值算法的可行选择。

英文摘要:

Currently, Python is one of the most widely used languages in various application areas. However, it has limitations when it comes to optimizing and parallelizing applications due to the nature of its official CPython interpreter, especially for CPU-bound applications. To solve this problem, several alternative translators have emerged, each with a different approach and its own cost-performance ratio. Due to the absence of comparative studies, we have carried out a performance comparison of these translators using N-Body as a case study (a well-known problem with high computational demand). The results obtained show that CPython and PyPy presented poor performance due to their limitations when it comes to parallelizing algorithms; while Numba and Cython achieved significantly higher performance, proving to be viable options to speed up numerical algorithms.

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

↑