Visible to the public Energy Profiles of Java Collections Classes

TitleEnergy Profiles of Java Collections Classes
Publication TypeConference Paper
Year of Publication2016
AuthorsHasan, Samir, King, Zachary, Hafiz, Munawar, Sayagh, Mohammed, Adams, Bram, Hindle, Abram
Conference NameProceedings of the 38th International Conference on Software Engineering
Date PublishedMay 2016
PublisherACM
Conference LocationNew York, NY, USA
ISBN Number978-1-4503-3900-1
KeywordsAPI, APIs, applications programming interfaces, collections, compositionality, energy profile, Java, pubcrawl, Resiliency
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.

URLhttps://dl.acm.org/doi/10.1145/2884781.2884869
DOI10.1145/2884781.2884869
Citation Keyhasan_energy_2016