TY - JOUR
T1 - Improving energy-efficiency by recommending Java collections
AU - Oliveira, Wellington
AU - Oliveira, Renato
AU - Castor, Fernando
AU - Pinto, Gustavo
AU - Fernandes, João Paulo
N1 - Funding Information:
We would like to thank the anonymous reviewers for helping to improve this paper. This paper acknowledges the support of the Erasmus+ Key Action 2 (Strategic partnership for higher education) project No. 2020-1-PT01-KA203-078646: ”SusTrainable - Promoting Sustainability as a Fundamental Driver in Software Development Training and Education”. The information and views set out in this paper are those of the author(s) and do not necessarily reflect the official opinion of the European Union. Neither the European Union institutions and bodies nor any person acting on their behalf may be held responsible for the use which may be made of the information contained therein. This research was partially funded by CAPES/Brazil (88887.364121/2019-00), CNPq/Brazil (304755/2014-1, 406308/2016-0, 465614/2014-0, 309032/2019-9), FACEPE/Brazil (APQ-0839-1.03/14, 0388-1.03/14, 0592-1.03/15).
Funding Information:
We would like to thank the anonymous reviewers for helping to improve this paper. This paper acknowledges the support of the Erasmus+ Key Action 2 (Strategic partnership for higher education) project No. 2020-1-PT01-KA203-078646: ”SusTrainable - Promoting Sustainability as a Fundamental Driver in Software Development Training and Education”. The information and views set out in this paper are those of the author(s) and do not necessarily reflect the official opinion of the European Union. Neither the European Union institutions and bodies nor any person acting on their behalf may be held responsible for the use which may be made of the information contained therein. This research was partially funded by CAPES/Brazil (88887.364121/2019-00), CNPq/Brazil (304755/2014-1, 406308/2016-0, 465614/2014-0, 309032/2019-9), FACEPE/Brazil (APQ-0839-1.03/14, 0388-1.03/14, 0592-1.03/15).
Publisher Copyright:
© 2021, The Author(s), under exclusive licence to Springer Science+Business Media, LLC part of Springer Nature.
PY - 2021/5
Y1 - 2021/5
N2 - Over the last years, increasing attention has been given to creating energy-efficient software systems. However, developers still lack the knowledge and the tools to support them in that task. In this work, we explore our vision that non-specialists can build software that consumes less energy by alternating diversely-designed pieces of software without increasing the development complexity. To support our vision, we propose an approach for energy-aware development that combines the construction of application-independent energy profiles of Java collections and static analysis to produce an estimate of in which ways and how intensively a system employs these collections. We implement this approach in a tool named CT+ that works with both desktop and mobile Java systems and is capable of analyzing 39 different collection implementations of lists, maps, and sets. We applied CT+ to seventeen software systems: two mobile-based, twelve desktop-based, and three that can run in both environments. Our evaluation infrastructure involved a high-end server, two notebooks, three smartphones, and a tablet. Overall, 2295 recommendations were applied, achieving up to 16.34% reduction in energy consumption, usually changing a single line of code per recommendation. Even for a real-world, mature system such as Tomcat, CT+ could achieve a 4.12% reduction in energy consumption. Our results indicate that some widely used collections, e.g., ArrayList, HashMap, and Hashtable, are not energy- efficient and sometimes should be avoided when energy consumption is a major concern.
AB - Over the last years, increasing attention has been given to creating energy-efficient software systems. However, developers still lack the knowledge and the tools to support them in that task. In this work, we explore our vision that non-specialists can build software that consumes less energy by alternating diversely-designed pieces of software without increasing the development complexity. To support our vision, we propose an approach for energy-aware development that combines the construction of application-independent energy profiles of Java collections and static analysis to produce an estimate of in which ways and how intensively a system employs these collections. We implement this approach in a tool named CT+ that works with both desktop and mobile Java systems and is capable of analyzing 39 different collection implementations of lists, maps, and sets. We applied CT+ to seventeen software systems: two mobile-based, twelve desktop-based, and three that can run in both environments. Our evaluation infrastructure involved a high-end server, two notebooks, three smartphones, and a tablet. Overall, 2295 recommendations were applied, achieving up to 16.34% reduction in energy consumption, usually changing a single line of code per recommendation. Even for a real-world, mature system such as Tomcat, CT+ could achieve a 4.12% reduction in energy consumption. Our results indicate that some widely used collections, e.g., ArrayList, HashMap, and Hashtable, are not energy- efficient and sometimes should be avoided when energy consumption is a major concern.
KW - Collections
KW - Energy consumption
KW - Recommendation systems
UR - http://www.scopus.com/inward/record.url?scp=85104277680&partnerID=8YFLogxK
U2 - 10.1007/s10664-021-09950-y
DO - 10.1007/s10664-021-09950-y
M3 - Article
SN - 1382-3256
VL - 26
JO - Empirical Software Engineering
JF - Empirical Software Engineering
IS - 3
M1 - 55
ER -