Code once, Run Green: Automated Green Code Translation in Serverless Computing
Preprint
Abstract
The rapid digitization and the increasing use of emerging technologies such as AI models have significantly contributed to the emissions of computing infrastructure. Efforts to mitigate this impact typically focus on the infrastructure level such as powering data centers with renewable energy, or through the specific design of energy-efficient software. However, both strategies rely on stakeholder intervention, making their adoption in legacy and already-deployed systems unlikely. As a result, past architectural and implementation decisions continue to incur additional energy usage - a phenomenon we refer to as energy debt. Hence, in this paper, we investigate the potential of serverless computing platforms to automatically reduce energy debt by leveraging the unique access to function source code. Specifically, we explore whether large language models (LLMs) can translate serverless functions into more energy-efficient programming languages while preserving functional correctness. To this end, we design and implement ReFaaS and integrate it into the Fission serverless framework. We evaluate multiple LLMs on their ability to perform such code translations and analyze their impact on energy consumption. Our preliminary results indicate that translated functions can reduce invocation energy by up to 70%, achieving net energy savings after approximately 3,000 to 5,000 invocations, depending on the LLM used. Nonetheless, the approach faces several challenges: not all functions are suitable for translation, and for some, the amortization threshold is significantly higher or unreachable. Despite these limitations, we identify four key research challenges whose resolution could unlock long-term, automated mitigation of energy debt in serverless computing.Keywords
All Related Versions
- Version 1, 2025-09-26, ArXiv
- Published version: , 105.
This publication has 11 references indexed in Scilit:
- Impact of power consumption in containerized clouds: A comprehensive analysis of open-source power measurement toolsComputer Networks, 2024
- Data centers cooling: A critical review of techniques, challenges, and energy saving solutionsInternational Journal of Refrigeration, 2024
- Challenges and Opportunities in Sustainable Serverless ComputingACM SIGEnergy Energy Informatics Review, 2023
- The Impact of Green Feedback on Users’ Software UsageIEEE Transactions on Sustainable Computing, 2022
- Ranking programming languages by energy efficiencyScience of Computer Programming, 2021
- Assessing the suitability of the Greenhouse Gas Protocol for calculation of emissions from public cloud computing workloadsJournal of Cloud Computing, 2020
- DATAZERO: Datacenter With Zero Emission and Robust Management Using Renewable EnergyIEEE Access, 2019
- Causing factors, outcomes, and governance of Shadow IT and business-managed IT: a systematic literature reviewInternational Journal of Information Systems and Project Management, 2019
- Technical Debt: From Metaphor to Theory and PracticeIEEE Software, 2012
- Energy-Efficient DatacentersIEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2012