Does the choice of programming language affect energy consumption? Previous highly visible studies have established associations between certain programming languages and energy consumption. A causal misinterpretation of this work has led academics and industry leaders to use or support certain languages based on their claimed impact on energy consumption. This paper tackles this causal question directly. It first corrects and improves the measurement methodology used by prior work. It then develops a detailed causal model capturing the complex relationship between programming language choice and energy consumption. This model identifies and incorporates several critical but previously overlooked factors that affect energy usage. These factors, such as distinguishing programming languages from their implementations, the impact of the application implementations themselves, the number of active cores, and memory activity, can significantly skew energy consumption measurements if not accounted for. We show -- via empirical experiments, improved methodology, and careful examination of anomalies -- that when these factors are controlled for, notable discrepancies in prior work vanish. Our analysis suggests that the choice of programming language implementation has no significant impact on energy consumption beyond execution time.
翻译:编程语言的选择是否影响能源消耗?先前备受关注的研究已确立某些编程语言与能耗之间的关联。对此项工作的因果性误读导致学术界和产业界领袖基于其宣称的能耗影响而采用或支持特定语言。本文直接探讨这一因果问题:首先修正并改进既有研究的测量方法学;继而构建精细的因果模型,以捕捉编程语言选择与能耗间的复杂关系。该模型识别并整合了若干关键但既往被忽视的能耗影响因素——包括区分编程语言与其具体实现、应用程序实现本身的影响、活跃核心数及内存活动等——若未加考量,这些因素可能显著扭曲能耗测量结果。我们通过实证实验、改进方法学及对异常值的审慎检验表明:当控制这些变量时,既有研究中的显著差异即告消失。分析指出,在排除执行时间影响后,编程语言实现的选择对能源消耗并无显著影响。