arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2212.07597cs.PLcs.PF
收藏

使用Scalene三角测量Python性能问题

Triangulating Python Performance Issues with Scalene

Emery D. Berger, Sam Stern, Juan Altmayer Pizzorno

摘要:

本文提出了Scalene,一个专门针对Python的分析器。Scalene结合了一系列创新技术,可同时精确地分析CPU、内存和GPU的使用情况,而且开销很低。Scalene的CPU和内存分析器通过区分低效的Python和高效的本机执行时间和内存使用情况,帮助Python程序员指导他们的优化工作。Scalene的内存分析器采用了一种新颖的采样算法,使其能够以低开销但高精度的方式运行。它还集成了一种新颖的算法,可以自动精确定位内存泄漏,无论是在Python内部还是跨Python原生边界。Scalene跟踪了一个名为复制量的新指标,该指标突出了Python在C和Python数据表示之间或CPU和GPU之间进行静默转换时可能发生的昂贵复制操作。自推出以来,Scalene已被广泛采用,迄今为止下载量超过50万次。我们提供了来自使用Scalene实现显著性能改进和内存节省的开发人员的经验报告。

英文摘要:

This paper proposes Scalene, a profiler specialized for Python. Scalene combines a suite of innovations to precisely and simultaneously profile CPU, memory, and GPU usage, all with low overhead. Scalene's CPU and memory profilers help Python programmers direct their optimization efforts by distinguishing between inefficient Python and efficient native execution time and memory usage. Scalene's memory profiler employs a novel sampling algorithm that lets it operate with low overhead yet high precision. It also incorporates a novel algorithm that automatically pinpoints memory leaks, whether within Python or across the Python-native boundary. Scalene tracks a new metric called copy volume, which highlights costly copying operations that can occur when Python silently converts between C and Python data representations, or between CPU and GPU. Since its introduction, Scalene has been widely adopted, with over 500,000 downloads to date. We present experience reports from developers who used Scalene to achieve significant performance improvements and memory savings.

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

↑