As the energy footprint generated by software is increasing at an alarming rate, understanding how to develop energy-efficient applications has become a necessity. Previous work has introduced catalogs of coding practices, also known as energy patterns. These patterns are yet limited to Mobile or third-party libraries. In this study, we focus on the Web domain--a main source of energy consumption. First, we investigated whether and how Mobile energy patterns could be ported to this domain and found that 20 patterns could be ported. Then, we interviewed six expert web developers from different companies to challenge the ported patterns. Most developers expressed concerns for antipatterns, specifically with functional antipatterns, and were able to formulate guidelines to locate these patterns in the source code. Finally, to quantify the effect of Web energy patterns on energy consumption, we set up an automated pipeline to evaluate two ported patterns: 'Dynamic Retry Delay' (DRD) and 'Open Only When Necessary' (OOWN). With this, we found no evidence that the DRD pattern consumes less energy than its antipattern, while the opposite is true for OOWN. Data and Material: https://doi.org/10.5281/zenodo.8404487
翻译:随着软件产生的能源足迹以惊人速度增长,理解如何开发节能应用已成为当务之急。已有研究介绍了代码实践目录(即能耗模式),但目前这些模式仅局限于移动端或第三方库。本研究聚焦于Web领域——这一主要的能源消耗源。首先,我们探究了移动端能耗模式能否及如何移植到该领域,发现其中20个模式可被移植。随后,我们访谈了来自不同公司的六位资深Web开发者,对移植模式进行验证。大多数开发者表达了对反模式的担忧,尤其是功能反模式,并能够制定出在源代码中定位这些模式的准则。最后,为量化Web能耗模式对能源消耗的影响,我们构建了自动化评估流水线,对两个移植模式——"动态重试延迟"(DRD)和"仅在必要时打开"(OOWN)进行评测。实验结果表明,无证据显示DRD模式相比其反模式更节能,而OOWN模式则呈现相反结论。数据与材料:https://doi.org/10.5281/zenodo.8404487