Improving software performance is an important yet challenging part of the software development cycle. Today, the majority of performance inefficiencies are identified and patched by performance experts. Recent advancements in deep learning approaches and the wide-spread availability of open source data creates a great opportunity to automate the identification and patching of performance problems. In this paper, we present DeepPERF, a transformer-based approach to suggest performance improvements for C# applications. We pretrain DeepPERF on English and Source code corpora and followed by finetuning for the task of generating performance improvement patches for C# applications. Our evaluation shows that our model can generate the same performance improvement suggestion as the developer fix in ~53% of the cases, getting ~34% of them verbatim in our expert-verified dataset of performance changes made by C# developers. Additionally, we evaluate DeepPERF on 50 open source C# repositories on GitHub using both benchmark and unit tests and find that our model is able to suggest valid performance improvements that can improve both CPU usage and Memory allocations. So far we've submitted 19 pull-requests with 28 different performance optimizations and 11 of these PRs have been approved by the project owners.
翻译:改进软件性能是软件开发周期中重要但具有挑战性的一部分。 今天, 大部分性能效率低下现象是由业绩专家确定和弥补的。 最近深层次学习方法的进步和开放源数据的广泛提供为自动识别和弥补性能问题提供了一个巨大的机会。 在本文中, 我们介绍了DeepPERF, 一种基于变压器的办法来建议C# 应用程序的性能改进。 我们用英语和源代码Corpora为EmpERF 和源代码公司预演了深层PERF, 并随后对为 C# 应用程序生成性能改进补丁的任务进行了微调。 我们的评估表明, 我们的模型可以产生与 ~ 53% 案例的开发者修正相同的性能改进建议, 在C# 开发者对性能变化进行的专家核查数据集中, 将其中的34% 逐字本地获得。 此外, 我们利用基准和单位测试, 对GitHub 的50 开源 C# 库进行深层PERF 评估,, 发现我们的模型能够建议有效的性能改进改进CU的使用和记忆分配。 因此, 我们提交了19个拉动要求, 得到了这些项目的所有者批准了28个不同的业绩优化和11个项目。