This slides aims at defining a Green Computing metrics called Energy Wasting Rate that consists in the normalized sum of the energy consumption differences between sub-components of a given component and components, behaviorally equivalent but energetically more efficient. I detail how to realize such metrics then we sketch how these metrics can be useful and relevant for static analysis focused on software energy consumption.
1. Energy Wasting Rate
a Metrics for Green Computing and Static Analysis
Jérôme Rocheteau
Institut Catholique d’Arts et Métiers, Nantes, France
2nd
International Workshop on
Measurement and Metrics for Green and Sustainable Software
Monday 5th
October 2015
Energy Wasting Rate MegSus | 2015-10-05 1 / 17
2. Context
ICT ≈ 15% total carbon emissions in 2014
devices smartphones, tablets, servers, ...
hardware energy efficiency
software energy efficiency
Green Computing
studies of software power features
impacts on software engineering
Energy Wasting Rate MegSus | 2015-10-05 2 / 17
3. Issues
Accuracy of Observation & Understanding
1 reliable measures (see [1])
2 relevant metrics
Energy Wasting Rate MegSus | 2015-10-05 3 / 17
5. Hypothesis
Top-Down Approach
from metrics definition to measurement system
1 needs
2 requirements
3 use cases
4 activities
5 sequences
6 classes
by reverse engineering our existing platform
using multi-dimensional statistical analysis
Energy Wasting Rate MegSus | 2015-10-05 4 / 17
6. Needs
1 Static Analysis
source code
2 Energy Consumption
attributes
methods
classes
3 Consumption Factors
execution time
RAM allocation
HDD access
network bandwidth
CPU load
4 Eco-Design Rules
gray pattern ← green pattern
rule priority
Energy Wasting Rate MegSus | 2015-10-05 5 / 17
7. Requirements
1 Fine-Grained Measurements M[e1, . . . , en]
2 Reliable Measurements |e|
3 Computational Equivalence e ≈ e
Energy Wasting Rate
ei ≈ ei iff
ei
.
= M ∈ C I
ei
.
= M ∈ C I
I = I and M = M
|ei | |ei |
|M| =
i=1
i=n |ei | − |ei |
i=1
i=n |ei |
Energy Wasting Rate MegSus | 2015-10-05 6 / 17
18. Data Model
Measure
• timestamp
• amount
Instrument
• identifier
• version
Category
• identifier
• unit
Test
• identifier
• method
Unit
• identifier
• type
Implements
Platform
• identifier
• version
Environment
• architecture
• operating system
• version
parent
class interface
Energy Wasting Rate MegSus | 2015-10-05 11 / 17
19. Statistical Analysis
List Interface Energy Consumption Analysis Request
select uc.identifier, t.method, avg(m.amount), std(m.amount)
from Measure m
inner join Test t on t.identifier = m.test
inner join Unit uc on uc.identifier = t.unit
inner join Implements ur on ur.class = uc.identifier
inner join Unit ui on ui.identifier = ur.interface
inner join Instrument i on i.identifier = m.instrument
where i.category = ’energy’
and ui.identifier = ’java.util.List’
group by uc.identifier, t.method with rollup
Energy Wasting Rate MegSus | 2015-10-05 12 / 17
20. Statistical Analysis
List Interface Energy Consumption Analysis Results
class method avg stddev
ArrayList add 16.45 6.33 %
ArrayList get 13.49 2.48 %
ArrayList new 17.46 4.48 %
ArrayList 15.80 4.43 %
LinkedList add 28.42 5.62 %
LinkedList get 27.05 9.95 %
LinkedList new 25.22 5.02 %
LinkedList 26.89 6.86 %
Energy Wasting Rate MegSus | 2015-10-05 13 / 17
21. Case Study
LinkedList vs ArrayList Fibonacci’s Sequence
1 p u b l i c L i s t <I n t e g e r > f i b o ( i n t n ) {
L i s t <I n t e g e r > l i s t = new L i n k e d L i s t <I n t e g e r >() ;
/∗ L i s t <I n t e g e r > l i s t = new A r r a y L i s t <I n t e g e r >(n ) ; ∗/
f o r ( i n t i = 0; i < n ; i ++) {
5 i f ( i < 2) {
l i s t . add ( i ) ;
} e l s e {
i n t x = l i s t . get ( i −1) ;
i n t y = l i s t . get ( i −2) ;
10 l i s t . add ( x + y ) ;
}
}
return l i s t ;
}
Energy Wasting Rate MegSus | 2015-10-05 14 / 17
23. Conclusion
Summary
Fine-Grained Measurements & Metrics
Instrumented & (Semi) Automatized Process
Perspectives
Energy Wasting Rate Metrics Validation
Test-Case Generation
Cross Analysis for Measurement of |e|
Dependant Code Refactoring
Energy Wasting Rate MegSus | 2015-10-05 16 / 17
24. References
• Jérôme Rocheteau, Virginie Gaillard, et Lamya Belhaj.
How Green are Java Best Coding Practices?
Barcelona, Espagne.
Markus Helfert, Karl-Heinz Krempels, et Brian Donnellan.
Proceedings of the 3rd
International Conference on Smart Grids and
Green IT Systems,
pages 235–246.
Barcelona, Espagne, Avril 2014.
Energy Wasting Rate MegSus | 2015-10-05 17 / 17