Experiments on Model-Based Software Energy Consumption Analysis Involving Sorting Algorithms

Danilo Silva Alves, Oseias Ayres Ferreira, Lucio Mauro Duarte, Davi Silva, Paulo Henrique Maia


Although energy has become an important aspect in software development, little support exists for creating energy-efficient programs. One reason for that is the lack of abstractions and tools to enable the analysis of relevant properties involving energy consumption. This paper presents the results of some experiments involving the gathering, modelling, and analysis of energy-related information, in particular, the costs of executing certain parts of a software. We combine some existing free and open-source tools to carry out the experiments, extending one of them to handle energy information. Our experiments consider a comparison of energy consumption of Java implementations of the Bubble Sort, Insertion Sort and Selection Sort algorithms using different data structures. We show how to combine an energy measurement tool and a model analysis tool to carry such a comparison. Based on this support and on our experiments, we believe this is a first step to allow developers to start creating more energy-efficient software.


Energy consumption; Behaviour models; Sorting algorithms

Full Text:



KHALID, H.; SHIHAB, E.; AL. et. What Do Mobile App Users Complain About? IEEE Software, v. 32, n. 3, p. 70–77, May 2015.

PINTO, G.; CASTOR, F. Energy efficiency: A new concern for application software developers. CACM, ACM, New York, NY, USA, v. 60, n. 12, p. 68–75, December 2017.

ALBERS, S. Energy-efficient algorithms. CACM, ACM, New York, NY, USA, v. 53, n. 5, p. 86–96, maio 2010. Disponível em: http://doi.acm.org/10.1145/1735223.1735245.

SINGH, V. K.; DUTTA, K.; AL. et. Estimating the energy consumption of executing software processes. In: Green-Com, iThings and CPSCom 2013. [S.l.: s.n.], 2013. p. 94–101.

KULKARNI, P. et al. Fast searches for effective optimization phase sequences. SIGPLAN Not., ACM, New York, NY, USA, v. 39, n. 6, p. 171–182, jun. 2004. Disponível em: http://doi.acm.org/10.1145/996893.996863.

KOOMEY, J. G. Worldwide electricity used in data centers. Environmental research letters, IOP Publishing, v. 3, n. 3, p. 034008, 2008.

WHITNEY, J.; DELFORGE, P. Data center efficiency assessment. Issue paper on NRDC (The Natural Resource Defense Council), 2014.

DORN, J. et al. Automatically exploring tradeoffs between software output fidelity and energy costs. IEEE Transactions on Software Engineering, IEEE, v. 45, n. 3, p. 219–236, 2017.

HUANG, C.; TSAO, S. Minimizing energy consumption of embedded systems via optimal code layout. IEEE Transactions on Computers, v. 61, n. 8, p. 1127–1139, Aug 2012.

RAGHUNATHAN, V. et al. Energy-aware wireless systems with adaptive power-fidelity tradeoffs. IEEE Transactions on Very Large Scale Integration (VLSI) Systems, v. 13, n. 2, p. 211–225, Feb 2005.

CHAI, Q. et al. Empowering Designers to Estimate Function-Level Power for Developing Green Applications. In: Proceedings - 2013 International Conference on Cloud and Service Computing, CSC 2013. [S.l.: s.n.], 2013. p. 57–62.

PANG, C. et al. What do programmers know about software energy consumption? IEEE Software, IEEE, v. 33, n. 3, p. 83–89, 2015.

MANOTAS, I.; POLLOCK, L.; CLAUSE, J. Seeds: a software engineer’s energy-optimization decision support framework. In: ACM. Proceedings of the 36th International Conference on Software Engineering. [S.l.], 2014. p. 503–514.

DUARTE, L. M. et al. A model-based framework for the analysis of software energy consumption. In: ACM. Proceedings of the XXXIII Brazilian Symposium on Software Engineering. [S.l.], 2019. p. 67–72.

LIU, K.; PINTO, G.; AL. et. Data-oriented characterization of application-level energy optimization. In: EGYED, A.; SCHAEFER, I. (Ed.). Fundamental Approaches to Software Engineering. Berlin, Heidelberg: Springer Berlin Heidelberg, 2015. p. 316–331.

KELLER, R. M. Formal Verification of Parallel Programs. CACM, v. 19, n. 7, p. 371–384, July 1976.

BARBOSA, D. M. et al. Lotus@Runtime: A Tool for Runtime Monitoring and Verification of Self-adaptive Systems. In: Proceedings of the 12th International Symposium on Software Engineering for Adaptive and Self-Managing Systems. Piscataway, NJ, USA: IEEE Press, 2017. (SEAMS ’17), p. 24–30. Disponível em: https://doi.org/10.1109/SEAMS.2017.18.

LI, D.; HALFOND, W. G. J. An Investigation into Energy-saving Programming Practices for Android Smartphone App Development. In: Proceedings of the 3rd International Workshop on Green and Sustainable Software. New York, NY, USA: ACM, 2014. (GREENS 2014), p. 46–53. Disponível em: http://doi.acm.org/10.1145/2593743.2593750.

BINKERT, N.; BECKMANN, B.; AL. et. The Gem5 Simulator. SIGARCH Comput. Archit. News, ACM, New York, NY, USA, v. 39, n. 2, p. 1–7, ago. 2011.

LI, S. et al. McPAT: An Integrated Power, Area, and Timing Modeling Framework for Multicore and Manycore Architectures. In: 2009 42nd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). [S.l.: s.n.], 2009. p. 469–480.

PEREIRA, R.; COUTO, M.; AL. et. The influence of the Java collection framework on overall energy consumption. In: ACM. Proceedings of the 5th International Workshop on Green and Sustainable Software. [S.l.], 2016. p. 15–21.

KWIATKOWSKA, M.; NORMAN, G.; AL. et. PRISM: Probabilistic symbolic model checker. In: KEMPER, P. (Ed.). Proc. of the Tools Session of Aachen 2001 Intl Multiconference on Measurement, Modelling and Evaluation of Computer-Communication Systems. [S.l.: s.n.], 2001. p. 7–12. Available as Technical Report 760/2001, University of Dortmund.

DUARTE, L. M.; KRAMER, J.; AL. et. Using contexts to extract models from code. Software and Systems Modeling, v. 16, n. 2, p. 523–557, 2017.

BUNSE, C. et al. Exploring the energy consumption of data sorting algorithms in embedded and mobile environments.In: IEEE. 2009 Tenth International Conference on Mobile Data Management: Systems, Services and Middleware. [S.l.], 2009. p. 600–607.

FOWLER, M. Refactoring: improving the design of existing code. [S.l.]: Addison-Wesley Professional, 2018.

CHENG, B. H. et al. Software engineering for self-adaptive systems: A research roadmap. In: Software engineering for self-adaptive systems. [S.l.]: Springer, 2009. p. 1–26.

NAKAJIMA, S. Model checking of energy consumption behavior. In: CARDIN, M.-A. et al. (Ed.). Complex Systems Design & Management Asia. Cham: Springer International Publishing, 2015. p. 3–14.

BAIER, C.; DUBSLAFF, C. et al. Probabilistic model checking for energy-utility analysis. In: ____. Horizons of the Mind. A Tribute to Prakash Panangaden: Essays Dedicated to Prakash Panangaden on the Occasion of His 60th Birthday. Cham: Springer International Publishing, 2014. p. 96–123. Disponível em: https://doi.org/10.1007/978-3-319-06880-05.

DUBSLAFF, C.; KLÜPPELHOLZ, S.; BAIER, C. Probabilistic model checking for energy analysis in software product lines. In: MODULARITY ’14. New York, NY, USA: ACM, 2014. (MODULARITY ’14), p. 169–180. Disponível em: http://doi.acm.org/10.1145/2577080.2577095.

HASAN, S. et al. Energy profiles of java collections classes. In: ACM. 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE). [S.l.], 2016. p. 225–236.

OLIVEIRA, W.; OLIVEIRA, R.; AL. et. Recommending energy-efficient java collections. In: IEEE PRESS. MSR 2019. [S.l.], 2019. p. 160–170.

SCHUBERT, S. et al. Profiling software for energy consumption. In: 2012 IEEE International Conference on Green Computing and Communications. [S.l.: s.n.], 2012. p. 515–522.

PEREIRA, R. Locating energy hotspots in source code. In: 39th International Conference on Software Engineering (ICSE 2017). [S.l.: s.n.], 2017. p. 88–90.

BRANDOLESE, C. et al. The impact of source code transformations on software power and energy consumption. Journal of Circuits, Systems, and Computers, World Scientific, v. 11, n. 05, p. 477–502, 2002.

JAYASEELAN, R.; MITRA, T.; LI, X. Estimating the worst-case energy consumption of embedded software. In: IEEE. 12th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS’06). [S.l.], 2006. p. 81–90.

HAO, S. et al. Estimating mobile application energy consumption using program analysis. In: IEEE PRESS. 35th In- ternational Conference on Software Engineering (ICSE 2013). [S.l.], 2013. p. 92–101.

COUTO, M. et al. Detecting anomalous energy consumption in android applications. In: SPRINGER. Brazilian Symposium on Programming Languages. [S.l.], 2014. p. 77–91.

MCINTOSH, A.; HASSAN, S.; HINDLE, A. What can android mobile app developers do about the energy consumption of machine learning? Empirical Software Engineering, Springer, v. 24, n. 2, p. 562–601, 2019.

LINARES-VÁSQUEZ, M. et al. Optimizing energy consumption of GUIs in Android apps: a multi-objective approach. In: ACM. Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering. [S.l.], 2015. p. 143–154.

PETKE, J. et al. Genetic improvement of software: A comprehensive survey. IEEE Transactions on Evolutionary Computation, v. 22, n. 3, p. 415–432, June 2018.

SINGH, J.; NAIK, K.; MAHINTHAN, V. Impact of developer choices on energy consumption of software on servers. Procedia Computer Science, Elsevier, v. 62, p. 385–394, 2015.

ZHANG, C.; HINDLE, A.; GERMAN, D. M. The impact of user choice on energy consumption. IEEE software, IEEE, v. 31, n. 3, p. 69–75, 2014.

SAHIN, C. et al. Initial explorations on design pattern energy usage. In: 2012 First International Workshop on Green and Sustainable Software (GREENS). [S.l.: s.n.], 2012. p. 55–61.

OLIVEIRA, W.; OLIVEIRA, R.; CASTOR, F. A study on the energy consumption of android app development approaches. In: 2017 IEEE/ACM 14th International Conference on Mining Software Repositories (MSR). [S.l.: s.n.], 2017. p. 42–52.

LINARES-VÁSQUEZ, M. et al. Mining energy-greedy api usage patterns in android apps: An empirical study. In: Proceedings of the 11th Working Conference on Mining Software Repositories. New York, NY, USA: ACM, 2014. (MSR 2014), p. 2–11. Disponível em: http://doi.acm.org/10.1145/2597073.2597085.

PEREIRA, R. et al. Helping programmers improve the energy efficiency of source code. In: Proceedings of the 39th International Conference on Software Engineering Companion. Piscataway, NJ, USA: IEEE Press, 2017. (ICSE-C ’17), p. 238–240. Disponível em: https://doi.org/10.1109/ICSE-C.2017.80.

COUTO, M. et al. Products go green: Worst-case energy consumption in software product lines. In: ACM. Proceedings of the 21st International Systems and Software Product Line Conference-Volume A. [S.l.], 2017. p. 84–93.

LIMA, L. G. et al. Haskell in green land: Analyzing the energy behavior of a purely functional language. In: IEEE. 2016 IEEE 23rd international conference on Software Analysis, Evolution, and Reengineering (SANER). [S.l.], 2016. v. 1, p. 517–528.

PINTO, G.; CASTOR, F.; LIU, Y. D. Understanding energy behaviors of thread management constructs. In: ACM. ACM SIGPLAN Notices. [S.l.], 2014. v. 49, n. 10, p. 345–360.

PEREIRA, R. et al. Energy efficiency across programming languages: How do energy, time, and memory relate? In: ACM. Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering. [S.l.], 2017. p. 256–267.

YUKI, T.; RAJOPADHYE, S. Folklore confirmed: Compiling for speed = compiling for energy. In: SPRINGER. International Workshop on Languages and Compilers for Parallel Computing. [S.l.], 2013. p. 169–184.

DOI: https://doi.org/10.22456/2175-2745.98904

Copyright (c) 2020 Danilo Silva Alves, Oseias Ayres Ferreira, Lucio Mauro Duarte, Paulo Henrique Maia, Davi Silva

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Indexing databases: