A Comprehensive Study on the Energy Efficiency of Java’s Thread-Safe Collections

Java programmers are served with numerous choices of collections, varying from simple sequential ordered lists to sophisticated hashtable implementations. These choices are well-known to have different characteristics in terms of performance, scalability, and thread-safety, and most of them are well studied. This paper analyzes an additional dimension, energy efficiency. We conducted an empirical investigation of 16 collection implementations (13 thread-safe, 3 non-thread-safe) grouped under 3 commonly used forms of collections (lists, sets, and mappings). Using micro-and real world-benchmarks (Tomcat and Xalan), we show that our results are meaningful and impactful. In general, we observed that simple design decisions can greatly impact energy consumption. In particular, we found that using a newer hashtable version can yield a 2.19x energy savings in the micro-benchmarks and up to 17% in the real world-benchmarks, when compared to the old associative implementation. Also, we observed that different implementations of the same thread-safe collection can have widely different energy consumption behaviors. This variation also applies to the different operations that each collection implements, e.g, a collection implementation that performs traversals very efficiently can be more than an order of magnitude less efficient than another implementation of the same collection when it comes to insertions.

[1]  Michael J. Carey,et al.  A bloat-aware design for big data applications , 2013, ISMM '13.

[2]  Yu David Liu,et al.  Rate types for stream programs , 2014, OOPSLA.

[3]  Jácome Cunha,et al.  The Influence of the Java Collection Framework on Overall Energy Consumption , 2016, 2016 IEEE/ACM 5th International Workshop on Green and Sustainable Software (GREENS).

[4]  Melanie Kambadur,et al.  An experimental survey of energy management across the stack , 2014, OOPSLA.

[5]  Lori L. Pollock,et al.  How do code refactorings affect energy usage? , 2014, ESEM '14.

[6]  Gustavo Pinto,et al.  Understanding energy behaviors of thread management constructs , 2014, OOPSLA 2014.

[7]  Ting Cao,et al.  The Yin and Yang of power and performance for asymmetric hardware and managed software , 2012, 2012 39th Annual International Symposium on Computer Architecture (ISCA).

[8]  Sam Malek,et al.  Component-Level Energy Consumption Estimation for Distributed Java-Based Software Systems , 2008, CBSE.

[9]  Eli Tilevich,et al.  Cloud refactoring: automated transitioning to cloud-based services , 2013, Automated Software Engineering.

[10]  Abram Hindle,et al.  Energy Profiles of Java Collections Classes , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[11]  Guoqing Xu,et al.  CoCo: Sound and Adaptive Replacement of Java Collections , 2013, ECOOP.

[12]  Jian Li,et al.  Power-performance considerations of parallel computing on chip multiprocessors , 2005, TACO.

[13]  Yu Lin,et al.  Retrofitting concurrency for Android applications through refactoring , 2014, FSE 2014.

[14]  Yu Lin,et al.  CHECK-THEN-ACT Misuse of Java Concurrent Collections , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[15]  Uwe Aßmann,et al.  Energy Consumption and Efficiency in Mobile Applications: A User Feedback Study , 2013, 2013 IEEE International Conference on Green Computing and Communications and IEEE Internet of Things and IEEE Cyber, Physical and Social Computing.

[16]  Fernando Castor Filho,et al.  Native or Web? A Preliminary Study on the Energy Consumption of Android Development Models , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[17]  David Holmes,et al.  Java Concurrency in Practice , 2006 .

[18]  Ding Li,et al.  An investigation into energy-saving programming practices for Android smartphone app development , 2014, GREENS 2014.

[19]  João Paulo Fernandes,et al.  Haskell in Green Land: Analyzing the Energy Behavior of a Purely Functional Language , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[20]  Ramesh Govindan,et al.  Calculating source line level energy information for Android applications , 2013, ISSTA.

[21]  Rahul Khanna,et al.  RAPL: Memory power estimation and capping , 2010, 2010 ACM/IEEE International Symposium on Low-Power Electronics and Design (ISLPED).

[22]  Hermann Härtig,et al.  Measuring energy consumption for short code paths using RAPL , 2012, PERV.

[23]  Emerson Murphy-Hill,et al.  Improving software developers' fluency by recommending development environment commands , 2012, SIGSOFT FSE.

[24]  Narseo Vallina-Rodriguez,et al.  Energy Management Techniques in Modern Mobile Handsets , 2013, IEEE Communications Surveys & Tutorials.

[25]  Gustavo Pinto,et al.  Data-Oriented Characterization of Application-Level Energy Optimization , 2015, FASE.

[26]  Luca Benini,et al.  A survey of design techniques for system-level dynamic power management , 2000, IEEE Trans. Very Large Scale Integr. Syst..

[27]  Lori L. Pollock,et al.  SEEDS: a software engineer's energy-optimization decision support framework , 2014, ICSE.

[28]  Stefan Marr,et al.  Fork/join parallelism in the wild: documenting patterns and anti-patterns in Java programs using the fork/join framework , 2014, PPPJ.

[29]  William G. J. Halfond,et al.  How Does Code Obfuscation Impact Energy Usage? , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[30]  Lori L. Pollock,et al.  Initial explorations on design pattern energy usage , 2012, 2012 First International Workshop on Green and Sustainable Software (GREENS).

[31]  Hridesh Rajan,et al.  Boa: A language and infrastructure for analyzing ultra-large-scale software repositories , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[32]  Eli Tilevich,et al.  Reducing the Energy Consumption of Mobile Applications Behind the Scenes , 2013, 2013 IEEE International Conference on Software Maintenance.

[33]  Gustavo Pinto,et al.  A large-scale study on the usage of Java's concurrent programming constructs , 2015, J. Syst. Softw..

[34]  Michael Cohen,et al.  Energy types , 2012, OOPSLA '12.

[35]  Michael D. Ernst,et al.  Refactoring sequential Java code for concurrency via concurrent libraries , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[36]  Wu-chun Feng,et al.  Towards energy-proportional computing for enterprise-class server workloads , 2013, ICPE '13.

[37]  Fernando Castor,et al.  Characterizing the Energy Efficiency of Java’s Thread-Safe Collections in a Multi-Core Environment , 2014 .

[38]  Anantha P. Chandrakasan,et al.  Low-power CMOS digital design , 1992 .

[39]  Ying Zhang,et al.  Refactoring android Java code for on-demand computation offloading , 2012, OOPSLA '12.

[40]  Janak H. Patel,et al.  A low-overhead coherence solution for multiprocessors with private cache memories , 1984, ISCA '84.

[41]  Yu David Liu,et al.  Energy-efficient work-stealing language runtimes , 2014, ASPLOS.

[42]  Giuseppe Scanniello,et al.  On the Effect of Exploiting GPUs for a More Eco-Sustainable Lease of Life , 2015, Int. J. Softw. Eng. Knowl. Eng..

[43]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.