energy wasting rate jérôme rocheteau

24
Energy Wasting Rate a Metrics for Green Computing and Static Analysis Jérôme Rocheteau Institut Catholique d’Arts et Métiers, Nantes, France 2 nd International Workshop on Measurement and Metrics for Green and Sustainable Software Monday 5 th October 2015 Energy Wasting Rate MegSus | 2015-10-05 1 / 17

Upload: iwsm-mensura

Post on 21-Jan-2017

178 views

Category:

Software


0 download

TRANSCRIPT

Energy Wasting Ratea Metrics for Green Computing and Static Analysis

Jérôme Rocheteau

Institut Catholique d’Arts et Métiers, Nantes, France

2nd International Workshop onMeasurement and Metrics for Green and Sustainable Software

Monday 5th October 2015

Energy Wasting Rate MegSus | 2015-10-05 1 / 17

Context

ICT ≈ 15% total carbon emissions in 2014

devices ↗ smartphones, tablets, servers, ...hardware ↗ energy efficiencysoftware ↘ energy efficiency

Green Computing

studies of software power featuresimpacts on software engineering

Energy Wasting Rate MegSus | 2015-10-05 2 / 17

Issues

Accuracy of Observation & Understanding1 reliable measures (see [1])2 relevant metrics

Double Shift

hardware → softwarebinary code → source code

Energy Wasting Rate MegSus | 2015-10-05 3 / 17

Issues

Accuracy of Observation & Understanding1 reliable measures (see [1])2 relevant metrics

Double Shift

hardware → softwarebinary code → source code

Energy Wasting Rate MegSus | 2015-10-05 3 / 17

Hypothesis

Top-Down Approach

from metrics definition to measurement system1 needs2 requirements3 use cases4 activities5 sequences6 classes

by reverse engineering our existing platformusing multi-dimensional statistical analysis

Energy Wasting Rate MegSus | 2015-10-05 4 / 17

Needs

1 Static Analysissource code

2 Energy Consumptionattributesmethodsclasses

3 Consumption Factorsexecution timeRAM allocationHDD accessnetwork bandwidthCPU load

4 Eco-Design Rulesgray pattern ← green patternrule priority

Energy Wasting Rate MegSus | 2015-10-05 5 / 17

Requirements

1 Fine-Grained Measurements M[e1, . . . , en]

2 Reliable Measurements |e|3 Computational Equivalence e ≈ e′

Energy Wasting Rateei ≈ e′i iff

ei.= M ∈ C � I

e′i

.= M ′ ∈ C ′ � I ′

I = I ′ and M = M ′

|ei | 6 |e′i |

|M| =∑i=1

i=n |ei | − |e′i |∑i=1i=n |ei |

Energy Wasting Rate MegSus | 2015-10-05 6 / 17

Use Cases

register codes

generate tests

launch measures

analyze results

Energy Wasting Rate MegSus | 2015-10-05 7 / 17

Measurement Process

Code MaturityChecking

1-MeasurementLaunching

1-MeasurementCleansing

∗-MeasurementPruning

yes

no

Code Maturity: measurement result stability

measurement set size > 25measurement set standard deviation 6 10%

Energy Wasting Rate MegSus | 2015-10-05 8 / 17

Measurement Task

Actor Platform Sensors

resultstop

launch

start

warm-updeploy

infoinfo

Energy Wasting Rate MegSus | 2015-10-05 9 / 17

Measurement Protocol

Measurement Raw Data

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

Measurement Protocol

Measurement Analyzed Data

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

Measurement Protocol

Measurement Normalized Data

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

Measurement Protocol

Protocol: space × time

different available space domains:

electric power (watt) energy (1 joule = 1 watt · second)RAM allocation ? (kb · second)HDD access ? (kb · second)network bandwidth ? (kb · second)CPU load ? (rate · second)

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

Measurement Protocol

Cleansing: removing disturbed measurements ... before

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

Measurement Protocol

Cleansing: removing disturbed measurements ... after

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

Measurement Protocol

Pruning: removing disturbed measurements ... during

Energy Wasting Rate MegSus | 2015-10-05 10 / 17

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

Statistical Analysis

List Interface Energy Consumption Analysis Requestselect uc.identifier, t.method, avg(m.amount), std(m.amount)from Measure minner join Test t on t.identifier = m.testinner join Unit uc on uc.identifier = t.unitinner join Implements ur on ur.class = uc.identifierinner join Unit ui on ui.identifier = ur.interfaceinner join Instrument i on i.identifier = m.instrumentwhere 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

Statistical Analysis

List Interface Energy Consumption Analysis Results

class method avg stddevArrayList 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

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 edL 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 Ar r a yL 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 . ge t ( i −1) ;i n t y = l i s t . ge t ( i −2) ;

10 l i s t . add ( x + y ) ;}

}r e t u r n l i s t ;

}

Energy Wasting Rate MegSus | 2015-10-05 14 / 17

Case Study

Theoretical Estimate

method occ ArrayList LinkedList differencenew 1 17.46 25.22 7.76add 2 16.45 28.42 11.97get 2 13.49 27.05 13.56fibo 77.34 136.16 58.82

Empirical Measure

Fibonacci’s ArrayList Sequence: 325.88 nano-JoulesFibonacci’s LinkedList Sequence: 372.29 nano-Joulesdifference = 46.41 nano-Joules

Error Margin: 26.73%

Energy Wasting Rate MegSus | 2015-10-05 15 / 17

Conclusion

Summary

Fine-Grained Measurements & MetricsInstrumented & (Semi) Automatized Process

Perspectives

Energy Wasting Rate Metrics ValidationTest-Case GenerationCross Analysis for Measurement of |e|Dependant Code Refactoring

Energy Wasting Rate MegSus | 2015-10-05 16 / 17

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 andGreen IT Systems,pages 235–246.Barcelona, Espagne, Avril 2014.

Energy Wasting Rate MegSus | 2015-10-05 17 / 17