Investigating the Use of GitHub Copilot for Green Software
摘要
This study empirically investigates the use of GitHub Copilot in developing energy-efficient software and the associated trade-offs. We compare the energy consumption and performance of human-written code to (i) the human-written code optimized by using GitHub Copilot, and (ii) code generated by GitHub Copilot. A set of 15 programming scenarios is used to test our hypothesis. GitHub Copilot is prompted for energy-efficient solutions. Our results demonstrate that GitHub Copilot-generated code can achieve significantly lower energy consumption when optimized, without compromising code quality. The study did not find statistically significant differences in energy consumption compared to human-written code. However, it highlights the potential of AI-assisted coding tools such as GitHub Copilot for developing energy-efficient software and the importance of explicitly prompting for energy consumption.