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

一种经过验证的软件能耗异味分类

Watts This Smell: A Comprehensive Taxonomy of Software Energy Smells

Dalhousie University(达尔豪斯大学)

Mohammadjavad Mehditabar, Saurabhsingh Rajput, Tushar Sharma

AI总结:

本文提出了一种全面的软件能耗异味分类,通过系统文献综述和雪球抽样,将320种低效模式分类为12种主要能耗异味和65种根本原因。通过实证验证,发现71%的样本存在多种共存的异味,内存相关异味的修复节能效果最高。

摘要:

随着软件在各领域的普及,其总体能耗足迹已成为主要关注点。为了减少软件的环境足迹,开发者需要识别和重构能耗异味:导致计算资源低效使用的源代码实现、设计选择或编程实践。现有异味目录要么领域特定,要么仅限于性能反模式,缺乏细粒度的根本原因分类,或未经过测量能耗数据的验证。本文提出了一种全面的、语言无关的软件能耗异味分类。通过系统文献综述60篇论文和详尽的雪球抽样,我们将320种低效模式编码为12种主要能耗异味和65种根本原因映射到主要异味。为了实证验证该分类,我们对21,000对功能等效的Python代码对进行能耗、时间和内存的分析,并通过多步骤LLM流程对前3000对进行分类,将65种根本原因中的55种映射到真实代码。分析表明,71%的样本存在多种共存的异味,内存相关异味的修复节能效果最高,而不同模式的能耗差异证实了能耗优化不能仅归因于性能优化。此外,我们发布了包含能耗资料和推理轨迹的标注数据集,为能耗异味检测、能耗高效代码生成和绿色软件工程提供了共享词汇、可操作的重构指南和实证基础。

英文摘要:

As software proliferates across domains, its aggregate energy footprint has become a major concern. To reduce software's growing environmental footprint, developers need to identify and refactor energy smells: source code implementations, design choices, or programming practices that lead to inefficient use of computing resources. Existing catalogs of such smells are either domain-specific, limited to performance anti-patterns, lack fine-grained root cause classification, or remain unvalidated against measured energy data. In this paper, we present a comprehensive, language-agnostic, taxonomy of software energy smells. Through a systematic literature review of 60 papers and exhaustive snowballing, we coded 320 inefficiency patterns into 12 primary energy smells and 65 root causes mapped to the primary smells. To empirically validate this taxonomy, we profile over 21,000 functionally equivalent Python code pairs for energy, time, and memory, and classified the top 3000 pairs by energy difference using a multi-step LLM pipeline, mapping 55 of the 65 root causes to real code. The analysis reveals that 71% of samples exhibit multiple co-occurring smells, memory-related smells yield the highest per-fix energy savings, while power draw variation across patterns confirms that energy optimization cannot be reduced to performance optimization alone. Along with the taxonomy, we release the labeled dataset, including energy profiles and reasoning traces, to the community. Together, they provide a shared vocabulary, actionable refactoring guidelines, and an empirical foundation for energy smell detection, energy-efficient code generation, and green software engineering at large.

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

↑