ABSTRACT
We created detailed profiles of the energy consumed by common operations done on Java List, Map, and Set abstractions. The results show that the alternative data types for these abstractions differ significantly in terms of energy consumption depending on the operations. For example, an ArrayList consumes less energy than a LinkedList if items are inserted at the middle or at the end, but consumes more energy than a LinkedList if items are inserted at the start of the list. To explain the results, we explored the memory usage and the bytecode executed during an operation. Expensive computation tasks in the analyzed bytecode traces appeared to have an energy impact, but memory usage did not contribute. We evaluated our profiles by using them to selectively replace Collections types used in six applications and libraries. We found that choosing the wrong Collections type, as indicated by our profiles, can cost even 300% more energy than the most efficient choice. Our work shows that the usage context of a data structure and our measured energy profiles can be used to decide between alternative Collections implementations.
- S. A. Abtahizadeh, F. Khomh, and Y.-G. Guéhéneuc. How green are cloud patterns? In Proceedings of the 34th IEEE International Performance Computing and Communications Conference (IPCCC), Nanjing, China, December 2015. Google ScholarDigital Library
- Apache commons collections. http://commons.apache.org/proper/commons-collections/source-repository.html.Google Scholar
- Apache commons configuration. https://commons.apache.org/proper/commons-configuration/index.html.Google Scholar
- Commons math: The apache commons mathematics library. https://commons.apache.org/proper/commons-math/.Google Scholar
- K. Aggarwal, C. Zhang, J. C. Campbell, A. Hindle, and E. Stroulia. The power of system call traces: Predicting the software energy consumption impact of changes. In Press of the 2014 Conference of the Center for Advanced Studies on Collaborative Research, IBM Corp, 2014.Google Scholar
- N. Amsel and B. Tomlinson. Green tracker: a tool for estimating the energy consumption of software. In CHI'10 Extended Abstracts on Human Factors in Computing Systems, pages 3337--3342. ACM, 2010. Google ScholarDigital Library
- D. Brooks, V. Tiwari, and M. Martonosi. Wattch: A framework for architectural-level power analysis and optimizations. In Proceedings of the 27th Annual International Symposium on Computer Architecture, ISCA '00, pages 83--94, New York, NY, USA, 2000. ACM. Google ScholarDigital Library
- C. Bunse, H. Hopfner, E. Mansour, and S. Roychoudhury. Exploring the energy consumption of data sorting algorithms in embedded and mobile environments. In MDM'09. Tenth International Conference on, pages 600--607. IEEE, 2009. Google ScholarDigital Library
- C. Bunse, H. Höpfner, S. Roychoudhury, and E. Mansour. Choosing the" best" sorting algorithm for optimal energy consumption. In ICSOFT (2), pages 199--206, 2009.Google Scholar
- C. Bunse, Z. Schwedenschanze, and S. Stiemer. On the energy consumption of design patterns. In EASED@ BUIS, pages 7--8. Citeseer, 2013.Google ScholarCross Ref
- M. Dong, Y.-S. K. Choi, and L. Zhong. Power Modeling of Graphical User Interfaces on OLED Displays. In DAC 2009, DAC '09, pages 652--657, New York, NY, USA, 2009. ACM. Google ScholarDigital Library
- M. Dong and L. Zhong. Self-constructive high-rate system energy modeling for battery-powered mobile systems. In Proceedings of the 9th MobiSys, pages 335--348. ACM, 2011. Google ScholarDigital Library
- S. Götz, C. Wilke, S. Richly, and U. Aßmann. Approximating quality contracts for energy auto-tuning software. In GREENS 2012, pages 8--14, June 2012. Google ScholarDigital Library
- S. Götz, C. Wilke, M. Schmidt, S. Cech, and Uwe. Towards energy auto tuning, Aug. 21 2013.Google Scholar
- Google gson. https://code.google.com/p/google-gson/.Google Scholar
- J. Gui, S. Mcilroy, M. Nagappan, and W. G. J. Halfond. Truth in advertising: The hidden cost of mobile ads for software developers. In Proceedings of the 37th International Conference on Software Engineering - Volume 1, ICSE '15, pages 100--110, Piscataway, NJ, USA, 2015. IEEE Press. Google ScholarDigital Library
- A. Gupta, T. Zimmermann, C. Bird, N. Nagappan, T. Bhat, and S. Emran. Detecting Energy Patterns in Software Development. Technical Report MSR-TR-2011-106, Microsoft Research, 2011.Google Scholar
- S. Gurumurthi, A. Sivasubramaniam, M. J. Irwin, N. Vijaykrishnan, and M. Kandemir. Using complete machine simulation for software power estimation: The softwatt approach. In Proceedings of the HPCA8, pages 141--150. IEEE, 2002. Google ScholarDigital Library
- S. Hao, D. Li, W. G. Halfond, and R. Govindan. Estimating android applications' cpu energy usage via bytecode profiling. In GREENS, 2012 First International Workshop on, pages 1--7. IEEE, 2012. Google ScholarDigital Library
- A. Hindle. Green mining: A methodology of relating software change and configuration to power consumption. Empirical Softw. Engg., 20(2):374--409, Apr. 2015. Google ScholarDigital Library
- A. Hindle, A. Wilson, K. Rasmussen, E. J. Barlow, J. C. Campbell, and S. Romansky. Greenminer: a hardware based mining software repositories software energy consumption framework. In Proc. of the 11th MSR, pages 12--21. ACM, 2014. Google ScholarDigital Library
- N. Hunt, P. S. Sandhu, and L. Ceze. Characterizing the performance and energy efficiency of lock-free data structures. In INTERACT, pages 63--70. IEEE, 2011. Google ScholarDigital Library
- R. S. Infantes, G. Beltrame, F. Khomh, E. Alba, and G. Antoniol. Optimizing user experience in choosing android applications. In Proceedings of the 23rd IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER), Osaka, Japan, March 2016.Google Scholar
- Java collections framework. http://docs.oracle.com/javase/8/docs/technotes/guides/collections/.Google Scholar
- Java parser. https://github.com/javaparser/javaparser.Google Scholar
- K-9 mail. http://k9mail.org/.Google Scholar
- D. Li, S. Hao, W. G. Halfond, and R. Govindan. Calculating source line level energy information for android applications. In Proceedings of the 2013 ISSTA, pages 78--89. ACM, 2013. Google ScholarDigital Library
- M. Linares-Vásquez, G. Bavota, C. Bernal-Cárdenas, R. Oliveto, M. Di Penta, and D. Poshyvanyk. Mining energy-greedy api usage patterns in android apps: an empirical study. In Proceedings of the 11th Working Conference on MSR, pages 2--11. ACM, 2014. Google ScholarDigital Library
- A. Litke, K. Zotos, A. Chatzigeorgiou, and G. Stephanides. Energy consumption analysis of design patterns. In Proceedings of the International Conference on Machine Learning and Software Engineering, pages 86--90. Centre for Telematics and Information Technology, University of Twente, 2005.Google Scholar
- I. Manotas, L. Pollock, and J. Clause. Seeds: A software engineer's energy-optimization decision support framework. In Proceedings of the 36th ICSE, pages 503--514. ACM, 2014. Google ScholarDigital Library
- I. Manotas, C. Sahin, J. Clause, L. Pollock, and K. Winbladh. Investigating the impacts of web servers on web application energy usage. In GREENS, 2013 2nd International Workshop on, pages 16--23. IEEE, 2013. Google ScholarDigital Library
- T. Mudge, T. Austin, and D. Grunwald. The reference manual for the sim-panalyzer version 2.0.Google Scholar
- A. Noureddine, R. Rouvoy, and L. Seinturier. Unit testing of energy consumption of software libraries. In Proceedings of the 29th Annual ACM Symposium on Applied Computing, SAC '14, pages 1200--1205, New York, NY, USA, 2014. ACM. Google ScholarDigital Library
- C. Pang, A. Hindle, B. Adams, and A. E. Hassan. What do programmers know about the energy consumption of software? PeerJ PrePrints, 3, 2015.Google Scholar
- J. J. Park, J. Hong, and S. Lee. Investigation for software power consumption of code refactoring techniques. In Proc. of the 26th International Conference on Software Engineering and Knowledge (SEKE), pages 717--722, 2014.Google Scholar
- A. Pathak, Y. C. Hu, and M. Zhang. Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In Proceedings of the 10th ACM Workshop on Hot Topics in Networks, page 5. ACM, 2011. Google ScholarDigital Library
- P. M. Phothilimthana, J. Ansel, J. Ragan-Kelley, and S. Amarasinghe. Portable performance on heterogeneous architectures. In ASPLOS 2013, ASPLOS '13, pages 431--444, New York, NY, USA, 2013. ACM. Google ScholarDigital Library
- G. Pinto, F. Castor, and Y. D. Liu. Mining questions about software energy consumption. In Proceedings of the 11th Working Conference on MSR, pages 22--31. ACM, 2014. Google ScholarDigital Library
- K. Rasmussen, A. Wilson, and A. Hindle. Green mining: energy consumption of advertisement blocking methods. In H. A. Müller, P. Lago, M. Morisio, N. Meyer, and G. Scanniello, editors, GREENS 2014, pages 38--45. ACM, 2014. Google ScholarDigital Library
- C. Sahin, F. Cayci, I. L. M. Gutierrez, J. Clause, F. Kiamilev, L. Pollock, and K. Winbladh. Initial explorations on design pattern energy usage. In GREENS, 2012, pages 55--61. IEEE, 2012. Google ScholarDigital Library
- C. Sahin, L. Pollock, and J. Clause. How do code refactorings affect energy usage? In ESEM, pages 36:1--36:10, New York, NY, USA, 2014. ACM. Google ScholarDigital Library
- C. Sahin, P. Tornquist, R. Mckenna, Z. Pearson, and J. Clause. How does code obfuscation impact energy usage? In Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, ICSME '14, pages 131--140, Washington, DC, USA, 2014. IEEE Computer Society. Google ScholarDigital Library
- A. Sakti, G. Pesant, and Y.-G. Guéhéneuc. Instance generator and problem representation to improve object oriented code coverage. IEEE Transactions on Software Engineering, pages 1--1, To appear, 2015.Google ScholarDigital Library
- O. Shacham, M. Vechev, and E. Yahav. Chameleon: Adaptive selection of collections. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '09, pages 408--418, New York, NY, USA, 2009. ACM. Google ScholarDigital Library
- D. Singh and W. J. Kaiser. The atom leap platform for energy-efficient embedded computing. Center for Embedded Network Sensing, 2010.Google Scholar
- V. Tiwari, S. Malik, and A. Wolfe. Power analysis of embedded software: a first step towards software power minimization. Very Large Scale Integration (VLSI) Systems, IEEE Transactions on, 2(4):437--445, 1994. Google ScholarDigital Library
- Trove. http://trove.starlight-systems.com/.Google Scholar
- T. J. watson libraries for analysis (wala). http://wala.sourceforge.net/wiki/index.php/Main_Page.Google Scholar
- Watts up. https://www.wattsupmeters.com/secure/products.php?pn=0.Google Scholar
- C. Wilke, S. Richly, S. Gotz, C. Piechnick, and U. Aßmann. Energy consumption and efficiency in mobile applications: A user feedback study. In GreenCom 2013, (iThings/CPSCom) and CPSCom, pages 134--141. IEEE, 2013. Google ScholarDigital Library
- Xstream. http://xstream.codehaus.org/.Google Scholar
- W. Ye, N. Vijaykrishnan, M. Kandemir, and M. J. Irwin. The design and use of simplepower: a cycle-accurate energy estimation tool. In Proceedings of DAC, pages 340--345. ACM, 2000. Google ScholarDigital Library
- C. Zhang, A. Hindle, and D. M. Germán. The impact of user choice on energy consumption. IEEE Software, 31(3):69--75, 2014.Google ScholarCross Ref
- L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R. P. Dick, Z. M. Mao, and L. Yang. Accurate Online Power Estimation and Automatic Battery Behavior Based Power Model Generation for Smartphones. In CODES/ISSS '10, pages 105--114, New York, NY, USA, 2010. ACM. Google ScholarDigital Library
Index Terms
- Energy profiles of Java collections classes
Recommendations
Empirical Study of Usage and Performance of Java Collections
ICPE '17: Proceedings of the 8th ACM/SPEC on International Conference on Performance EngineeringCollection data structures have a major impact on the performance of applications, especially in languages such as Java, C#, or C++. This requires a developer to select an appropriate collection from a large set of possibilities, including different ...
Evaluating the Java Native Interface JNI: Leveraging Existing Native Code, Libraries and Threads to a Running Java Virtual Machine
This article aims to explore JNI features and to discover fundamental operations of the Java programming language, such as arrays, objects, classes, threads and exception handling, and to illustrate these by using various algorithms and code samples. ...
Improving energy-efficiency by recommending Java collections
AbstractOver 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-...
Comments