SlideShare a Scribd company logo
How Green are Java Best Practices?
Best Coding Practices and Software Eco-Design
Jérôme Rocheteau
Institut Catholique d’Arts et Métiers, Nantes, France
GreenDays@Rennes – Mardi 1er juillet 2014
How Green are Java Best Practices? GreenDays | 2014-07-01 1 / 33
Overview
1 Eco-Design and Best Practices
2 Formalizing Practices
3 Measuring Codes
4 Analyzing Measures, Codes, Practices
5 Eco-Design Indicators
How Green are Java Best Practices? GreenDays | 2014-07-01 2 / 33
Eco-Design and Best Practices
1 Eco-Design and Best Practices
Context and Issues
Hypothesis and Objectives
2 Formalizing Practices
3 Measuring Codes
4 Analyzing Measures, Codes, Practices
5 Eco-Design Indicators
How Green are Java Best Practices? GreenDays | 2014-07-01 3 / 33
Context and Issues
Context:
ICT accounted 2% of carbon emissions in 2007
Energy efficiency relies on hardware but not software
Works on energy efficiency classes, energy-aware systems
Issues:
Help developers to build energy-efficient software
1 Detect energy-consuming patterns in source code
2 Replace these patterns by energy-saving ones
Qualify the energy impact for such best practices
How Green are Java Best Practices? GreenDays | 2014-07-01 4 / 33
Hypothesis and Objectives
Hypothesis
Best coding practices are eco-design rules
Objectives:
1 Formalizing Java best practices
2 Measuring savings of memory and energy at runtime
3 Evaluating confidence of such results
How Green are Java Best Practices? GreenDays | 2014-07-01 5 / 33
Formalizing Practices
1 Eco-Design and Best Practices
2 Formalizing Practices
Informal and Formal Examples
Time, Space, Energy Semantics
3 Measuring Codes
4 Analyzing Measures, Codes, Practices
5 Eco-Design Indicators
How Green are Java Best Practices? GreenDays | 2014-07-01 6 / 33
Informal and Formal Examples
Best Coding Practice Example / Informal Rule:
String Literal Initialization
Initialization of strings with the keyword ’new’ creates new
objects. This is costly in time and memory space. Initializations
with literal strings avoids this.
How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
Informal and Formal Examples
Best Coding Practice Example / Informal Rule:
String Literal Initialization
Initialization of strings with the keyword ’new’ creates new
objects. This is costly in time and memory space. Initializations
with literal strings avoids this.
Three shape of Java best coding practices :
1 Prefer this
2 Avoid that
3 Replace that by this
How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
Informal and Formal Examples
Best Coding Practice Example / Informal Rule:
String Literal Initialization
Initialization of strings with the keyword ’new’ creates new
objects. This is costly in time and memory space. Initializations
with literal strings avoids this.
Three shape of Java best coding practices :
1 Prefer this
2 Avoid that
3 Replace that by this
Can be extended to other primitive/wrapper types
How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
Informal and Formal Examples
Best Coding Practice Example / Informal Rule:
String Literal Initialization
Initialization of strings with the keyword ’new’ creates new
objects. This is costly in time and memory space. Initializations
with literal strings avoids this.
Three shape of Java best coding practices :
1 Prefer this
2 Avoid that
3 Replace that by this
Can be extended to other primitive/wrapper types
Can be applied to other programming languages
How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
Informal and Formal Examples
Best Coding Practice Example / Informal Rule:
String Literal Initialization
Initialization of strings with the keyword ’new’ creates new
objects. This is costly in time and memory space. Initializations
with literal strings avoids this.
Three shape of Java best coding practices :
1 Prefer this
2 Avoid that
3 Replace that by this
Can be extended to other primitive/wrapper types
Can be applied to other programming languages
How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
Informal and Formal Examples
Listing 1: Prefer String Literal Initialization
<rule id="prefer-string-literal-initialization">
<title>Prefer string literal initialization</title>
<description>
Primitive type objects should be initialized with primitive values
and without the use of any constructors.
</description>
<check green="StringValue" gray="StringObject" />
</rule>
How Green are Java Best Practices? GreenDays | 2014-07-01 8 / 33
Informal and Formal Examples
Listing 2: String Literal Initialization
p u b l i c c l a s s S t r i n g V a l u e implements Code {
p r i v a t e S t r i n g [ ] a r r a y ;
p u b l i c void setUp () {
a r r a y = new S t r i n g [ 1 0 0 0 ] ;
}
p u b l i c void doRun () throws Exception {
f o r ( i n t i = 0; i < 1000; i ++) {
a r r a y [ i ] = " abcdefg . . . " ;
}
}
p u b l i c void tearDown () {
a r r a y = n u l l ;
}
}
How Green are Java Best Practices? GreenDays | 2014-07-01 9 / 33
Informal and Formal Examples
Listing 3: String Object Initialization
p u b l i c c l a s s S t r i n g O b j e c t implements Code {
p r i v a t e S t r i n g [ ] a r r a y ;
p u b l i c void setUp () {
a r r a y = new S t r i n g [ 1 0 0 0 ] ;
}
p u b l i c void doRun () throws Exception {
f o r ( i n t i = 0; i < 1000; i ++) {
a r r a y [ i ] = new S t r i n g ( " abcdefg . . . " ) ;
}
}
p u b l i c void tearDown () {
a r r a y = n u l l ;
}
}
How Green are Java Best Practices? GreenDays | 2014-07-01 10 / 33
Time, Space, Energy Semantics
Prefer Literal
Initialization
time = ft (td , tc )
space = fs (sd , sc )
energy = fe(ed , ec )
How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
Time, Space, Energy Semantics
String Value
Initialization
Prefer Literal
Initialization
String Object
Initialization
time = ft (td , tc )
space = fs (sd , sc )
energy = fe(ed , ec )
How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
Time, Space, Energy Semantics
String Value
Initialization
Prefer Literal
Initialization
String Object
Initialization
time tc
space sc
energy ec
time td
space sd
energy ed
time = ft (td , tc )
space = fs (sd , sc )
energy = fe(ed , ec )
How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
Time, Space, Energy Semantics
String Value
Initialization
Prefer Literal
Initialization
String Object
Initialization
time tc
space sc
energy ec
time td
space sd
energy ed
time = ft (td , tc )
space = fs (sd , sc )
energy = fe(ed , ec )
How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
Time, Space, Energy Semantics
Goal: statistical static analysis method and tools
original code
How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
Time, Space, Energy Semantics
Goal: statistical static analysis method and tools
original code
How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
Time, Space, Energy Semantics
Goal: statistical static analysis method and tools
original code refactored code
How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
Time, Space, Energy Semantics
Goal: statistical static analysis method and tools
original code refactored code
possible savings
X joules / X %
How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
Measuring Codes
1 Eco-Design and Best Practices
2 Formalizing Practices
3 Measuring Codes
Needs and Requirements
Measure Task and Process
4 Analyzing Measures, Codes, Practices
5 Eco-Design Indicators
How Green are Java Best Practices? GreenDays | 2014-07-01 13 / 33
Needs and Requirements
Needs:
Requirements:
How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
Needs and Requirements
Needs:
power-meter with digital outputs
Requirements:
power-meter with fine-grain precision
How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
Needs and Requirements
Needs:
power-meter with digital outputs
memory monitor with digital outputs
Requirements:
power-meter with fine-grain precision
How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
Needs and Requirements
Needs:
power-meter with digital outputs
memory monitor with digital outputs
platform for running Java codes
Requirements:
power-meter with fine-grain precision
Java micro-benchmarking to avoid JIT
How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
Needs and Requirements
Needs:
power-meter with digital outputs
memory monitor with digital outputs
platform for running Java codes
system for managing codes and measures
Requirements:
power-meter with fine-grain precision
Java micro-benchmarking to avoid JIT
system able to manage physical and logical sensors
How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
Measure Task and Process
Measurement Protocol:
1 4 seconds idle
2 10 seconds execution time
3 3 seconds idle
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Semantics based on quantitative metrics:
x-axis execution time
y-axis instant power or instant memory space
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Preliminary Computations:
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Preliminary Computations:
total energy obtained by the trapezoidal rule
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Preliminary Computations:
total energy obtained by the trapezoidal rule
idle power = average of the first 4 second instant powers
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Preliminary Computations:
total energy obtained by the trapezoidal rule
idle power = average of the first 4 second instant powers
idle energy = idle power × protocol time
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Code energy computation and normalization:
code energy = total energy - idle energy
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Code energy computation and normalization:
code energy = total energy - idle energy
normalized code energy = code energy / times of execution
How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
Measure Task and Process
Measure Process:
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Measure Task and Process
Measure Process:
1 Retrieve an available Java code
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Measure Task and Process
Measure Process:
1 Retrieve an available Java code
2 Iterate while this code isn’t mature:
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Measure Task and Process
Measure Process:
1 Retrieve an available Java code
2 Iterate while this code isn’t mature:
Clean its measure set
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Measure Task and Process
Measure Process:
1 Retrieve an available Java code
2 Iterate while this code isn’t mature:
Clean its measure set
Compute its maturity
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Measure Task and Process
Measure Process:
1 Retrieve an available Java code
2 Iterate while this code isn’t mature:
Clean its measure set
Compute its maturity
Plan new measures if required
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Measure Task and Process
Measure Process:
1 Retrieve an available Java code
2 Iterate while this code isn’t mature:
Clean its measure set
Compute its maturity
Plan new measures if required
Perform these measures
3 Send the report of this code
How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
Analyzing Measures, Codes, Practices
1 Eco-Design and Best Practices
2 Formalizing Practices
3 Measuring Codes
4 Analyzing Measures, Codes, Practices
Clean and Canonical Measures
Code Maturity
Results
5 Eco-Design Indicators
How Green are Java Best Practices? GreenDays | 2014-07-01 17 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
disturbances before the measure task underestimate
How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
disturbances before the measure task underestimate
disturbances after the measure task overestimate
How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
disturbances before the measure task underestimate
disturbances after the measure task overestimate
disturbances during the measure task overestimate
How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
disturbances before the measure task
disturbances after the measure task
disturbances during the measure task
2 mere algorithms for cleaning measures:
How Green are Java Best Practices? GreenDays | 2014-07-01 19 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
disturbances before the measure task
disturbances after the measure task
disturbances during the measure task
2 mere algorithms for cleaning measures:
bounds checking algorithm (over a single measure)
How Green are Java Best Practices? GreenDays | 2014-07-01 19 / 33
Clean and Canonical Measures
3 kinds of measure disturbances:
disturbances before the measure task
disturbances after the measure task
disturbances during the measure task
2 mere algorithms for cleaning measures:
bounds checking algorithm (over a single measure)
split-and-merge algorithm (over a set of measures)
How Green are Java Best Practices? GreenDays | 2014-07-01 19 / 33
Clean and Canonical Measures
Cleaning algorithm evaluation:
500 clean measures from 25 rules annotated by 3 experts
How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
Clean and Canonical Measures
Cleaning algorithm evaluation:
500 clean measures from 25 rules annotated by 3 experts
inter-agreement κ: 0.94 (almost perfect)
How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
Clean and Canonical Measures
Cleaning algorithm evaluation:
500 clean measures from 25 rules annotated by 3 experts
inter-agreement κ: 0.94 (almost perfect)
baseline = quartile method
precision: 0.953
recall: 0.911
How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
Clean and Canonical Measures
Cleaning algorithm evaluation:
500 clean measures from 25 rules annotated by 3 experts
inter-agreement κ: 0.94 (almost perfect)
baseline = quartile method
precision: 0.953
recall: 0.911
split-and-merge algorithm
precision: 0.941
recall: 1.0
How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
Clean and Canonical Measures
Cleaning algorithm evaluation:
500 clean measures from 25 rules annotated by 3 experts
inter-agreement κ: 0.94 (almost perfect)
baseline = quartile method
precision: 0.953
recall: 0.911
split-and-merge algorithm
precision: 0.941
recall: 1.0
remove all disturbed measures
How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
Clean and Canonical Measures
Canonical measure:
How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
Clean and Canonical Measures
Canonical measure:
time: t3
space: s3
energy: e3
time: t2
space: s2
energy: e2
time: t1
space: s1
energy: e1
How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
Clean and Canonical Measures
Canonical measure:
time: t3
space: s3
energy: e3
time: t2
space: s2
energy: e2
time: t1
space: s1
energy: e1
time: t
space: s
energy: e
How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
Clean and Canonical Measures
Canonical measure:
time: t3
space: s3
energy: e3
time: t2
space: s2
energy: e2
time: t1
space: s1
energy: e1
time: t
space: s
energy: e
How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
Clean and Canonical Measures
Canonical measure:
time: t3
space: s3
energy: e3
time: t2
space: s2
energy: e2
time: t1
space: s1
energy: e1
time: t
space: s
energy: e
How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
Clean and Canonical Measures
Canonical measure:
time: t3
space: s3
energy: e3
time: t2
space: s2
energy: e2
time: t1
space: s1
energy: e1
time: t
space: s
energy: e
error margin: 2%
How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
Code Maturity
Code Maturity
How many clean measures required for reliable results?
How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
Code Maturity
Code Maturity
How many clean measures required for reliable results?
0 20 40 60 80 100 120
5
10
15
Measure Number
RelativeStandardDeviation
How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
Code Maturity
Code Maturity
How many clean measures required for reliable results?
0 20 40 60 80 100 120
5
10
15
Measure Number
RelativeStandardDeviation
a set of 25 measures minimum
How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
Code Maturity
Code Maturity
How many clean measures required for reliable results?
0 20 40 60 80 100 120
5
10
15
Measure Number
RelativeStandardDeviation
a set of 25 measures minimum
a standard deviation less than 10%
How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
Results
Energy in nanojoules, time in nanoseconds
Memory in kilobytes
Standard Deviation on Energy
Replace Object Initialization by Literal Initialization
Rule Id
GreenEnergy
GrayEnergy
GreenTime
GrayTime
GreenMemory
GrayMemory
GreenStdDev
GrayStdDev
String 697 7885 842 7827 4136 36104 4.40% 8.14%
Float 10311 10448 4736 4127 20032 20032 5.85% 6.58%
Integer 685 9575 833 4591 4048 20032 5.21% 6.51%
Boolean 683 6267 775 4741 4048 20032 4.77% 7.03%
Char 695 33067 840 4595 4048 20032 5.04% 4.65%
Double 10003 10210 5810 4270 28032 28032 5.58% 7.83%
Long 669 8236 807 6066 4056 28032 2.89% 5.32%
Short 680 7819 819 3846 4048 20031 4.87% 7.71%
How Green are Java Best Practices? GreenDays | 2014-07-01 23 / 33
Results
Replace Object Initialization by Literal Initialization
Rule Id G
reen
Energy
G
ray
Energy
A
bsolute
G
ain
Relative
G
ain
String 697 7885 7188 91.16%
Float 10311 10448 137 1.31%
Integer 685 9575 8890 92.54%
Boolean 683 6267 5584 89.10%
Char 695 33067 32372 97.89%
Double 10003 10210 207 2.02%
Long 669 8236 7567 91.87%
Short 680 7819 7139 91.30%
How Green are Java Best Practices? GreenDays | 2014-07-01 24 / 33
Results
Rules for loops
A Prefer integer loop counters
B Avoid method loop conditions
C Prefer comparison-to-0 conditions
D Prefer first common condition
Id
GreenEnergy
GrayEnergy
GreenTime
GrayTime
GreenMemory
GrayMemory
GreenStdDev
GrayStdDev
A 82 98 4744 5931 16 16 8.66% 7.46%
B 8376 8602 6181 6364 20056 20056 3.83% 6.14%
C 89 284 4709 17367 16 16 5.09% 5.78%
D 97 100 4934 5017 16 16 4.37% 4.60%
How Green are Java Best Practices? GreenDays | 2014-07-01 25 / 33
Results
Rules for loops
A Prefer integer loop counters
B Avoid method loop conditions
C Prefer comparison-to-0 conditions
D Prefer first common condition
Id
G
reen
Energy
G
ray
Energy
A
bsolute
G
ain
Relative
G
ain
A 82 98 16 16.32%
B 8376 8602 226 2.62%
C 89 284 195 68.66%
D 97 100 3 3.00%
How Green are Java Best Practices? GreenDays | 2014-07-01 25 / 33
Results
Set String Builder or Buffer Size
A String Buffer/Builder capacity initialization
B String Buffer/Builder capacity setting
C String Buffer/Builder length setting
Id
GreenEnergy
GrayEnergy
GreenTime
GrayTime
GreenMemory
GrayMemory
GreenStdDev
GrayStdDev
A 593 1053 38085 59111 52056 73784 7.11% 8.40%
B 598 1053 38495 59111 52056 73784 7.86% 8.40%
C 1211 1053 59111 70765 73784 104064 8.40% 9.40%
A’ 378 899 19278 41088 52056 73784 8.27% 7.18%
B’ 429 899 41088 51214 73784 104064 7.18% 5.84%
C’ 1043 899 20976 41088 52056 73784 6.01% 7.18%
How Green are Java Best Practices? GreenDays | 2014-07-01 26 / 33
Results
Set String Builder or Buffer Size
A String Buffer/Builder capacity initialization
B String Buffer/Builder capacity setting
C String Buffer/Builder length setting
Id
G
reen
Energy
G
ray
Energy
A
bsolute
G
ain
Relative
G
ain
A 593 1053 460 43.68%
B 598 1053 455 43.20%
C 1211 1053 -158 -15.00%
A’ 378 899 521 57.95%
B’ 429 899 470 52.28%
C’ 1043 899 -144 -16.01%
How Green are Java Best Practices? GreenDays | 2014-07-01 26 / 33
Eco-Design Indicators
1 Eco-Design and Best Practices
2 Formalizing Practices
3 Measuring Codes
4 Analyzing Measures, Codes, Practices
5 Eco-Design Indicators
Summary
Future
How Green are Java Best Practices? GreenDays | 2014-07-01 27 / 33
Eco-Design Indicators
How Green are Java Best Practices? GreenDays | 2014-07-01 28 / 33
Eco-Design Indicators
Hypothesis
Best Coding Practices ≈ Eco-Design Rules
174 formalized and measured rules
How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
Eco-Design Indicators
Hypothesis
Best Coding Practices ≈ Eco-Design Rules
174 formalized and measured rules
55% rules huge savings (more than 10%)
How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
Eco-Design Indicators
Hypothesis
Best Coding Practices ≈ Eco-Design Rules
174 formalized and measured rules
55% rules huge savings (more than 10%)
20% rules few savings (between 3% and 10%)
How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
Eco-Design Indicators
Hypothesis
Best Coding Practices ≈ Eco-Design Rules
174 formalized and measured rules
55% rules huge savings (more than 10%)
20% rules few savings (between 3% and 10%)
15% rules no savings (between -3% and 3%)
How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
Eco-Design Indicators
Hypothesis
Best Coding Practices ≈ Eco-Design Rules
174 formalized and measured rules
55% rules huge savings (more than 10%)
20% rules few savings (between 3% and 10%)
15% rules no savings (between -3% and 3%)
10% rules some losses (less than -3%)
How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
hybrid physical and logical sensor management
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
hybrid physical and logical sensor management
complex client/server architecture
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
hybrid physical and logical sensor management
complex client/server architecture
focused star schema database
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
hybrid physical and logical sensor management
complex client/server architecture
focused star schema database
robust automatic iterative process
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
hybrid physical and logical sensor management
complex client/server architecture
focused star schema database
robust automatic iterative process
extensible programming API
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
With The Way: 1 reliable measure system
hybrid physical and logical sensor management
complex client/server architecture
focused star schema database
robust automatic iterative process
extensible programming API
reliable stable measure sets with few measures
How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
Eco-Design Indicators
• Jérôme Rocheteau, Virginie Gaillard, et Lamya Belhaj.
How Green are Java Best Coding Practices?
Proceedings of the 3rd International Conference on Smart
Grids and Green IT Systems,
pages 235–246.
Barcelona, Espagne, Avril 2014.
How Green are Java Best Practices? GreenDays | 2014-07-01 31 / 33
Future
1 Energy Efficiency Classes?
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
Relative savings
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
Relative savings
3 Rule indicators in different environments
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
Relative savings
3 Rule indicators in different environments
4 Rule indicators in different programming languages
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
Relative savings
3 Rule indicators in different environments
4 Rule indicators in different programming languages
5 Energy efficiency of different programming languages
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
Relative savings
3 Rule indicators in different environments
4 Rule indicators in different programming languages
5 Energy efficiency of different programming languages
6 Accuracy of different physical and/or logical sensors
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Future
1 Energy Efficiency Classes?
2 Eco-Design Indicators?
Absolute savings
Relative savings
3 Rule indicators in different environments
4 Rule indicators in different programming languages
5 Energy efficiency of different programming languages
6 Accuracy of different physical and/or logical sensors
7 Energy and memory footprints of logical sensors
How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
Thank you
How Green are Java Best Practices? GreenDays | 2014-07-01 33 / 33
Data Model
How Green are Java Best Practices? GreenDays | 2014-07-01 33 / 33

More Related Content

What's hot

Java String
Java StringJava String
Java String
Java2Blog
 
Introduction to NumPy
Introduction to NumPyIntroduction to NumPy
Introduction to NumPy
Huy Nguyen
 
F# for C# Programmers
F# for C# ProgrammersF# for C# Programmers
F# for C# Programmers
Scott Wlaschin
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
BASAVARAJ HUNSHAL
 
Bài 5 PHẦN MỀM HỆ THỐNG
Bài 5 PHẦN MỀM HỆ THỐNGBài 5 PHẦN MỀM HỆ THỐNG
Bài 5 PHẦN MỀM HỆ THỐNGMasterCode.vn
 
Helpful logging with python
Helpful logging with pythonHelpful logging with python
Helpful logging with python
roskakori
 
Tsp branch and-bound
Tsp branch and-boundTsp branch and-bound
Tsp branch and-bound
Saravanan Natarajan
 
Type hints in python & mypy
Type hints in python & mypyType hints in python & mypy
Type hints in python & mypy
Anirudh
 
Python programming : Files
Python programming : FilesPython programming : Files
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
Mobile API: Design & Techniques
Mobile API: Design & TechniquesMobile API: Design & Techniques
Mobile API: Design & Techniques
Fred Brunel
 
He thong cauhoi_sgk_sbt
He thong cauhoi_sgk_sbtHe thong cauhoi_sgk_sbt
He thong cauhoi_sgk_sbttin_k36
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
Akhil Kaushik
 
What is Python JSON | Edureka
What is Python JSON | EdurekaWhat is Python JSON | Edureka
What is Python JSON | Edureka
Edureka!
 
Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng
Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng
Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng
manhboanheo2
 
Tl automata
Tl automataTl automata
Tl automata
Luwx Mta
 
An introduction to Jupyter notebooks and the Noteable service
An introduction to Jupyter notebooks and the Noteable serviceAn introduction to Jupyter notebooks and the Noteable service
An introduction to Jupyter notebooks and the Noteable service
Jisc
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
Simplilearn
 
Analisa data di python dengan pandas
Analisa data di python dengan pandasAnalisa data di python dengan pandas
Analisa data di python dengan pandas
zakiakhmad
 
CSV Files-1.pdf
CSV Files-1.pdfCSV Files-1.pdf
CSV Files-1.pdf
AmitenduBikashDhusiy
 

What's hot (20)

Java String
Java StringJava String
Java String
 
Introduction to NumPy
Introduction to NumPyIntroduction to NumPy
Introduction to NumPy
 
F# for C# Programmers
F# for C# ProgrammersF# for C# Programmers
F# for C# Programmers
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
 
Bài 5 PHẦN MỀM HỆ THỐNG
Bài 5 PHẦN MỀM HỆ THỐNGBài 5 PHẦN MỀM HỆ THỐNG
Bài 5 PHẦN MỀM HỆ THỐNG
 
Helpful logging with python
Helpful logging with pythonHelpful logging with python
Helpful logging with python
 
Tsp branch and-bound
Tsp branch and-boundTsp branch and-bound
Tsp branch and-bound
 
Type hints in python & mypy
Type hints in python & mypyType hints in python & mypy
Type hints in python & mypy
 
Python programming : Files
Python programming : FilesPython programming : Files
Python programming : Files
 
Mobile API: Design & Techniques
Mobile API: Design & TechniquesMobile API: Design & Techniques
Mobile API: Design & Techniques
 
He thong cauhoi_sgk_sbt
He thong cauhoi_sgk_sbtHe thong cauhoi_sgk_sbt
He thong cauhoi_sgk_sbt
 
Decision Making & Loops
Decision Making & LoopsDecision Making & Loops
Decision Making & Loops
 
What is Python JSON | Edureka
What is Python JSON | EdurekaWhat is Python JSON | Edureka
What is Python JSON | Edureka
 
Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng
Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng
Cấu trúc dữ liệu và giải thuật - Lê Minh Hoàng
 
Tl automata
Tl automataTl automata
Tl automata
 
An introduction to Jupyter notebooks and the Noteable service
An introduction to Jupyter notebooks and the Noteable serviceAn introduction to Jupyter notebooks and the Noteable service
An introduction to Jupyter notebooks and the Noteable service
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
 
Analisa data di python dengan pandas
Analisa data di python dengan pandasAnalisa data di python dengan pandas
Analisa data di python dengan pandas
 
Prolog basics
Prolog basicsProlog basics
Prolog basics
 
CSV Files-1.pdf
CSV Files-1.pdfCSV Files-1.pdf
CSV Files-1.pdf
 

Viewers also liked

Secure Coding for Java - An introduction
Secure Coding for Java - An introductionSecure Coding for Java - An introduction
Secure Coding for Java - An introduction
Sebastien Gioria
 
Green Programming
Green ProgrammingGreen Programming
Green Programming
Grand Rapids Public Library
 
European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)GreenLabCenter
 
Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016
Łukasz Koniecki
 
Green Software Lab
Green Software LabGreen Software Lab
Green Software Lab
GreenLabAtDI
 
Introduction to the Green Code
Introduction to the Green CodeIntroduction to the Green Code
Introduction to the Green Codebuffalogreencode
 
Technology, apps, and websites you need to know about
Technology, apps, and websites you need to know aboutTechnology, apps, and websites you need to know about
Technology, apps, and websites you need to know about
Doug Green
 
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Jaak Vlasveld
 
Green-Language programming presentation
Green-Language programming presentationGreen-Language programming presentation
Green-Language programming presentationLorraine Cruz
 
3.2 System Design For Eco Efficiency
3.2 System Design For Eco Efficiency3.2 System Design For Eco Efficiency
3.2 System Design For Eco EfficiencyLeNS_slide
 
Towards Software Sustainability Assessment
Towards Software Sustainability AssessmentTowards Software Sustainability Assessment
Towards Software Sustainability Assessment
Patricia Lago
 
Ten green bottles
Ten green bottlesTen green bottles
Ten green bottles
gibertfortuny
 
Green Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject DetailsGreen Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject Details
Olivier Philippot
 
Green it
Green it  Green it
Green it
mashaathukorala
 
Software and Sustainability
Software and SustainabilitySoftware and Sustainability
Software and Sustainability
Patricia Lago
 
說服性科技 Persuasive technology
說服性科技 Persuasive technology說服性科技 Persuasive technology
說服性科技 Persuasive technology
Jill Hsu
 
Docker. Does it matter for Java developer ?
Docker. Does it matter for Java developer ?Docker. Does it matter for Java developer ?
Docker. Does it matter for Java developer ?
Izzet Mustafaiev
 
Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008
giosissa
 
Green ICT, sustainability and Open Source
Green ICT, sustainability and Open  SourceGreen ICT, sustainability and Open  Source
Green ICT, sustainability and Open Source
giosissa
 

Viewers also liked (20)

Web app security
Web app securityWeb app security
Web app security
 
Secure Coding for Java - An introduction
Secure Coding for Java - An introductionSecure Coding for Java - An introduction
Secure Coding for Java - An introduction
 
Green Programming
Green ProgrammingGreen Programming
Green Programming
 
European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)
 
Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016Java and effective programming. Is it possible? - IAESTE Case Week 2016
Java and effective programming. Is it possible? - IAESTE Case Week 2016
 
Green Software Lab
Green Software LabGreen Software Lab
Green Software Lab
 
Introduction to the Green Code
Introduction to the Green CodeIntroduction to the Green Code
Introduction to the Green Code
 
Technology, apps, and websites you need to know about
Technology, apps, and websites you need to know aboutTechnology, apps, and websites you need to know about
Technology, apps, and websites you need to know about
 
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
 
Green-Language programming presentation
Green-Language programming presentationGreen-Language programming presentation
Green-Language programming presentation
 
3.2 System Design For Eco Efficiency
3.2 System Design For Eco Efficiency3.2 System Design For Eco Efficiency
3.2 System Design For Eco Efficiency
 
Towards Software Sustainability Assessment
Towards Software Sustainability AssessmentTowards Software Sustainability Assessment
Towards Software Sustainability Assessment
 
Ten green bottles
Ten green bottlesTen green bottles
Ten green bottles
 
Green Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject DetailsGreen Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject Details
 
Green it
Green it  Green it
Green it
 
Software and Sustainability
Software and SustainabilitySoftware and Sustainability
Software and Sustainability
 
說服性科技 Persuasive technology
說服性科技 Persuasive technology說服性科技 Persuasive technology
說服性科技 Persuasive technology
 
Docker. Does it matter for Java developer ?
Docker. Does it matter for Java developer ?Docker. Does it matter for Java developer ?
Docker. Does it matter for Java developer ?
 
Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008
 
Green ICT, sustainability and Open Source
Green ICT, sustainability and Open  SourceGreen ICT, sustainability and Open  Source
Green ICT, sustainability and Open Source
 

Similar to How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01

2014 nicta-reproducibility
2014 nicta-reproducibility2014 nicta-reproducibility
2014 nicta-reproducibility
c.titus.brown
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best Practices
Supun Dissanayake
 
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Lionel Briand
 
11.query optimization to improve performance of the code execution
11.query optimization to improve performance of the code execution11.query optimization to improve performance of the code execution
11.query optimization to improve performance of the code executionAlexander Decker
 
Query optimization to improve performance of the code execution
Query optimization to improve performance of the code executionQuery optimization to improve performance of the code execution
Query optimization to improve performance of the code execution
Alexander Decker
 
A preliminary study on using code smells to improve bug localization
A preliminary study on using code smells to improve bug localizationA preliminary study on using code smells to improve bug localization
A preliminary study on using code smells to improve bug localization
krws
 
Siguccs20101026
Siguccs20101026Siguccs20101026
Siguccs20101026
Takashi Yamanoue
 
IA3_presentation.pptx
IA3_presentation.pptxIA3_presentation.pptx
IA3_presentation.pptx
KtonNguyn2
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
CodeOps Technologies LLP
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
Ganesh Samarthyam
 
Using SigOpt to Tune Deep Learning Models with Nervana Cloud
Using SigOpt to Tune Deep Learning Models with Nervana CloudUsing SigOpt to Tune Deep Learning Models with Nervana Cloud
Using SigOpt to Tune Deep Learning Models with Nervana Cloud
SigOpt
 
Using the Machine to predict Testability
Using the Machine to predict TestabilityUsing the Machine to predict Testability
Using the Machine to predict Testability
Miguel Lopez
 
Certified Reasoning for Automated Verification
Certified Reasoning for Automated VerificationCertified Reasoning for Automated Verification
Certified Reasoning for Automated Verification
Asankhaya Sharma
 
Abcd iqs ssoftware-projects-mercecrosas
Abcd iqs ssoftware-projects-mercecrosasAbcd iqs ssoftware-projects-mercecrosas
Abcd iqs ssoftware-projects-mercecrosas
Merce Crosas
 
Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Distributed deep learning_over_spark_20_nov_2014_ver_2.8Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Vijay Srinivas Agneeswaran, Ph.D
 
Sharing massive data analysis: from provenance to linked experiment reports
Sharing massive data analysis: from provenance to linked experiment reportsSharing massive data analysis: from provenance to linked experiment reports
Sharing massive data analysis: from provenance to linked experiment reports
Gaignard Alban
 
CS3114_09212011.ppt
CS3114_09212011.pptCS3114_09212011.ppt
CS3114_09212011.ppt
Arumugam90
 
Data Science & AI Syllabus - DS & AI.pdf
Data Science & AI Syllabus - DS & AI.pdfData Science & AI Syllabus - DS & AI.pdf
Data Science & AI Syllabus - DS & AI.pdf
Aayushdigichrome
 
Python & machine learning Syllabus - DS & AI.pdf
Python & machine learning Syllabus - DS & AI.pdfPython & machine learning Syllabus - DS & AI.pdf
Python & machine learning Syllabus - DS & AI.pdf
Aayushdigichrome
 

Similar to How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01 (20)

2014 toronto-torbug
2014 toronto-torbug2014 toronto-torbug
2014 toronto-torbug
 
2014 nicta-reproducibility
2014 nicta-reproducibility2014 nicta-reproducibility
2014 nicta-reproducibility
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best Practices
 
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
 
11.query optimization to improve performance of the code execution
11.query optimization to improve performance of the code execution11.query optimization to improve performance of the code execution
11.query optimization to improve performance of the code execution
 
Query optimization to improve performance of the code execution
Query optimization to improve performance of the code executionQuery optimization to improve performance of the code execution
Query optimization to improve performance of the code execution
 
A preliminary study on using code smells to improve bug localization
A preliminary study on using code smells to improve bug localizationA preliminary study on using code smells to improve bug localization
A preliminary study on using code smells to improve bug localization
 
Siguccs20101026
Siguccs20101026Siguccs20101026
Siguccs20101026
 
IA3_presentation.pptx
IA3_presentation.pptxIA3_presentation.pptx
IA3_presentation.pptx
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Using SigOpt to Tune Deep Learning Models with Nervana Cloud
Using SigOpt to Tune Deep Learning Models with Nervana CloudUsing SigOpt to Tune Deep Learning Models with Nervana Cloud
Using SigOpt to Tune Deep Learning Models with Nervana Cloud
 
Using the Machine to predict Testability
Using the Machine to predict TestabilityUsing the Machine to predict Testability
Using the Machine to predict Testability
 
Certified Reasoning for Automated Verification
Certified Reasoning for Automated VerificationCertified Reasoning for Automated Verification
Certified Reasoning for Automated Verification
 
Abcd iqs ssoftware-projects-mercecrosas
Abcd iqs ssoftware-projects-mercecrosasAbcd iqs ssoftware-projects-mercecrosas
Abcd iqs ssoftware-projects-mercecrosas
 
Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Distributed deep learning_over_spark_20_nov_2014_ver_2.8Distributed deep learning_over_spark_20_nov_2014_ver_2.8
Distributed deep learning_over_spark_20_nov_2014_ver_2.8
 
Sharing massive data analysis: from provenance to linked experiment reports
Sharing massive data analysis: from provenance to linked experiment reportsSharing massive data analysis: from provenance to linked experiment reports
Sharing massive data analysis: from provenance to linked experiment reports
 
CS3114_09212011.ppt
CS3114_09212011.pptCS3114_09212011.ppt
CS3114_09212011.ppt
 
Data Science & AI Syllabus - DS & AI.pdf
Data Science & AI Syllabus - DS & AI.pdfData Science & AI Syllabus - DS & AI.pdf
Data Science & AI Syllabus - DS & AI.pdf
 
Python & machine learning Syllabus - DS & AI.pdf
Python & machine learning Syllabus - DS & AI.pdfPython & machine learning Syllabus - DS & AI.pdf
Python & machine learning Syllabus - DS & AI.pdf
 

Recently uploaded

Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
silvermistyshot
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
moosaasad1975
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
Columbia Weather Systems
 
in vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptxin vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptx
yusufzako14
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
NathanBaughman3
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
aishnasrivastava
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
AADYARAJPANDEY1
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
University of Maribor
 
Leaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdfLeaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdf
RenuJangid3
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
role of pramana in research.pptx in science
role of pramana in research.pptx in sciencerole of pramana in research.pptx in science
role of pramana in research.pptx in science
sonaliswain16
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
IqrimaNabilatulhusni
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
Areesha Ahmad
 

Recently uploaded (20)

Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
 
in vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptxin vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptx
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
 
Leaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdfLeaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdf
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
role of pramana in research.pptx in science
role of pramana in research.pptx in sciencerole of pramana in research.pptx in science
role of pramana in research.pptx in science
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
 

How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01

  • 1. How Green are Java Best Practices? Best Coding Practices and Software Eco-Design Jérôme Rocheteau Institut Catholique d’Arts et Métiers, Nantes, France GreenDays@Rennes – Mardi 1er juillet 2014 How Green are Java Best Practices? GreenDays | 2014-07-01 1 / 33
  • 2. Overview 1 Eco-Design and Best Practices 2 Formalizing Practices 3 Measuring Codes 4 Analyzing Measures, Codes, Practices 5 Eco-Design Indicators How Green are Java Best Practices? GreenDays | 2014-07-01 2 / 33
  • 3. Eco-Design and Best Practices 1 Eco-Design and Best Practices Context and Issues Hypothesis and Objectives 2 Formalizing Practices 3 Measuring Codes 4 Analyzing Measures, Codes, Practices 5 Eco-Design Indicators How Green are Java Best Practices? GreenDays | 2014-07-01 3 / 33
  • 4. Context and Issues Context: ICT accounted 2% of carbon emissions in 2007 Energy efficiency relies on hardware but not software Works on energy efficiency classes, energy-aware systems Issues: Help developers to build energy-efficient software 1 Detect energy-consuming patterns in source code 2 Replace these patterns by energy-saving ones Qualify the energy impact for such best practices How Green are Java Best Practices? GreenDays | 2014-07-01 4 / 33
  • 5. Hypothesis and Objectives Hypothesis Best coding practices are eco-design rules Objectives: 1 Formalizing Java best practices 2 Measuring savings of memory and energy at runtime 3 Evaluating confidence of such results How Green are Java Best Practices? GreenDays | 2014-07-01 5 / 33
  • 6. Formalizing Practices 1 Eco-Design and Best Practices 2 Formalizing Practices Informal and Formal Examples Time, Space, Energy Semantics 3 Measuring Codes 4 Analyzing Measures, Codes, Practices 5 Eco-Design Indicators How Green are Java Best Practices? GreenDays | 2014-07-01 6 / 33
  • 7. Informal and Formal Examples Best Coding Practice Example / Informal Rule: String Literal Initialization Initialization of strings with the keyword ’new’ creates new objects. This is costly in time and memory space. Initializations with literal strings avoids this. How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
  • 8. Informal and Formal Examples Best Coding Practice Example / Informal Rule: String Literal Initialization Initialization of strings with the keyword ’new’ creates new objects. This is costly in time and memory space. Initializations with literal strings avoids this. Three shape of Java best coding practices : 1 Prefer this 2 Avoid that 3 Replace that by this How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
  • 9. Informal and Formal Examples Best Coding Practice Example / Informal Rule: String Literal Initialization Initialization of strings with the keyword ’new’ creates new objects. This is costly in time and memory space. Initializations with literal strings avoids this. Three shape of Java best coding practices : 1 Prefer this 2 Avoid that 3 Replace that by this Can be extended to other primitive/wrapper types How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
  • 10. Informal and Formal Examples Best Coding Practice Example / Informal Rule: String Literal Initialization Initialization of strings with the keyword ’new’ creates new objects. This is costly in time and memory space. Initializations with literal strings avoids this. Three shape of Java best coding practices : 1 Prefer this 2 Avoid that 3 Replace that by this Can be extended to other primitive/wrapper types Can be applied to other programming languages How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
  • 11. Informal and Formal Examples Best Coding Practice Example / Informal Rule: String Literal Initialization Initialization of strings with the keyword ’new’ creates new objects. This is costly in time and memory space. Initializations with literal strings avoids this. Three shape of Java best coding practices : 1 Prefer this 2 Avoid that 3 Replace that by this Can be extended to other primitive/wrapper types Can be applied to other programming languages How Green are Java Best Practices? GreenDays | 2014-07-01 7 / 33
  • 12. Informal and Formal Examples Listing 1: Prefer String Literal Initialization <rule id="prefer-string-literal-initialization"> <title>Prefer string literal initialization</title> <description> Primitive type objects should be initialized with primitive values and without the use of any constructors. </description> <check green="StringValue" gray="StringObject" /> </rule> How Green are Java Best Practices? GreenDays | 2014-07-01 8 / 33
  • 13. Informal and Formal Examples Listing 2: String Literal Initialization p u b l i c c l a s s S t r i n g V a l u e implements Code { p r i v a t e S t r i n g [ ] a r r a y ; p u b l i c void setUp () { a r r a y = new S t r i n g [ 1 0 0 0 ] ; } p u b l i c void doRun () throws Exception { f o r ( i n t i = 0; i < 1000; i ++) { a r r a y [ i ] = " abcdefg . . . " ; } } p u b l i c void tearDown () { a r r a y = n u l l ; } } How Green are Java Best Practices? GreenDays | 2014-07-01 9 / 33
  • 14. Informal and Formal Examples Listing 3: String Object Initialization p u b l i c c l a s s S t r i n g O b j e c t implements Code { p r i v a t e S t r i n g [ ] a r r a y ; p u b l i c void setUp () { a r r a y = new S t r i n g [ 1 0 0 0 ] ; } p u b l i c void doRun () throws Exception { f o r ( i n t i = 0; i < 1000; i ++) { a r r a y [ i ] = new S t r i n g ( " abcdefg . . . " ) ; } } p u b l i c void tearDown () { a r r a y = n u l l ; } } How Green are Java Best Practices? GreenDays | 2014-07-01 10 / 33
  • 15. Time, Space, Energy Semantics Prefer Literal Initialization time = ft (td , tc ) space = fs (sd , sc ) energy = fe(ed , ec ) How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
  • 16. Time, Space, Energy Semantics String Value Initialization Prefer Literal Initialization String Object Initialization time = ft (td , tc ) space = fs (sd , sc ) energy = fe(ed , ec ) How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
  • 17. Time, Space, Energy Semantics String Value Initialization Prefer Literal Initialization String Object Initialization time tc space sc energy ec time td space sd energy ed time = ft (td , tc ) space = fs (sd , sc ) energy = fe(ed , ec ) How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
  • 18. Time, Space, Energy Semantics String Value Initialization Prefer Literal Initialization String Object Initialization time tc space sc energy ec time td space sd energy ed time = ft (td , tc ) space = fs (sd , sc ) energy = fe(ed , ec ) How Green are Java Best Practices? GreenDays | 2014-07-01 11 / 33
  • 19. Time, Space, Energy Semantics Goal: statistical static analysis method and tools original code How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
  • 20. Time, Space, Energy Semantics Goal: statistical static analysis method and tools original code How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
  • 21. Time, Space, Energy Semantics Goal: statistical static analysis method and tools original code refactored code How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
  • 22. Time, Space, Energy Semantics Goal: statistical static analysis method and tools original code refactored code possible savings X joules / X % How Green are Java Best Practices? GreenDays | 2014-07-01 12 / 33
  • 23. Measuring Codes 1 Eco-Design and Best Practices 2 Formalizing Practices 3 Measuring Codes Needs and Requirements Measure Task and Process 4 Analyzing Measures, Codes, Practices 5 Eco-Design Indicators How Green are Java Best Practices? GreenDays | 2014-07-01 13 / 33
  • 24. Needs and Requirements Needs: Requirements: How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
  • 25. Needs and Requirements Needs: power-meter with digital outputs Requirements: power-meter with fine-grain precision How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
  • 26. Needs and Requirements Needs: power-meter with digital outputs memory monitor with digital outputs Requirements: power-meter with fine-grain precision How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
  • 27. Needs and Requirements Needs: power-meter with digital outputs memory monitor with digital outputs platform for running Java codes Requirements: power-meter with fine-grain precision Java micro-benchmarking to avoid JIT How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
  • 28. Needs and Requirements Needs: power-meter with digital outputs memory monitor with digital outputs platform for running Java codes system for managing codes and measures Requirements: power-meter with fine-grain precision Java micro-benchmarking to avoid JIT system able to manage physical and logical sensors How Green are Java Best Practices? GreenDays | 2014-07-01 14 / 33
  • 29. Measure Task and Process Measurement Protocol: 1 4 seconds idle 2 10 seconds execution time 3 3 seconds idle How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 30. Measure Task and Process Semantics based on quantitative metrics: x-axis execution time y-axis instant power or instant memory space How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 31. Measure Task and Process Preliminary Computations: How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 32. Measure Task and Process Preliminary Computations: total energy obtained by the trapezoidal rule How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 33. Measure Task and Process Preliminary Computations: total energy obtained by the trapezoidal rule idle power = average of the first 4 second instant powers How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 34. Measure Task and Process Preliminary Computations: total energy obtained by the trapezoidal rule idle power = average of the first 4 second instant powers idle energy = idle power × protocol time How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 35. Measure Task and Process Code energy computation and normalization: code energy = total energy - idle energy How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 36. Measure Task and Process Code energy computation and normalization: code energy = total energy - idle energy normalized code energy = code energy / times of execution How Green are Java Best Practices? GreenDays | 2014-07-01 15 / 33
  • 37. Measure Task and Process Measure Process: How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 38. Measure Task and Process Measure Process: 1 Retrieve an available Java code How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 39. Measure Task and Process Measure Process: 1 Retrieve an available Java code 2 Iterate while this code isn’t mature: How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 40. Measure Task and Process Measure Process: 1 Retrieve an available Java code 2 Iterate while this code isn’t mature: Clean its measure set How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 41. Measure Task and Process Measure Process: 1 Retrieve an available Java code 2 Iterate while this code isn’t mature: Clean its measure set Compute its maturity How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 42. Measure Task and Process Measure Process: 1 Retrieve an available Java code 2 Iterate while this code isn’t mature: Clean its measure set Compute its maturity Plan new measures if required How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 43. Measure Task and Process Measure Process: 1 Retrieve an available Java code 2 Iterate while this code isn’t mature: Clean its measure set Compute its maturity Plan new measures if required Perform these measures 3 Send the report of this code How Green are Java Best Practices? GreenDays | 2014-07-01 16 / 33
  • 44. Analyzing Measures, Codes, Practices 1 Eco-Design and Best Practices 2 Formalizing Practices 3 Measuring Codes 4 Analyzing Measures, Codes, Practices Clean and Canonical Measures Code Maturity Results 5 Eco-Design Indicators How Green are Java Best Practices? GreenDays | 2014-07-01 17 / 33
  • 45. Clean and Canonical Measures 3 kinds of measure disturbances: How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
  • 46. Clean and Canonical Measures 3 kinds of measure disturbances: disturbances before the measure task underestimate How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
  • 47. Clean and Canonical Measures 3 kinds of measure disturbances: disturbances before the measure task underestimate disturbances after the measure task overestimate How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
  • 48. Clean and Canonical Measures 3 kinds of measure disturbances: disturbances before the measure task underestimate disturbances after the measure task overestimate disturbances during the measure task overestimate How Green are Java Best Practices? GreenDays | 2014-07-01 18 / 33
  • 49. Clean and Canonical Measures 3 kinds of measure disturbances: disturbances before the measure task disturbances after the measure task disturbances during the measure task 2 mere algorithms for cleaning measures: How Green are Java Best Practices? GreenDays | 2014-07-01 19 / 33
  • 50. Clean and Canonical Measures 3 kinds of measure disturbances: disturbances before the measure task disturbances after the measure task disturbances during the measure task 2 mere algorithms for cleaning measures: bounds checking algorithm (over a single measure) How Green are Java Best Practices? GreenDays | 2014-07-01 19 / 33
  • 51. Clean and Canonical Measures 3 kinds of measure disturbances: disturbances before the measure task disturbances after the measure task disturbances during the measure task 2 mere algorithms for cleaning measures: bounds checking algorithm (over a single measure) split-and-merge algorithm (over a set of measures) How Green are Java Best Practices? GreenDays | 2014-07-01 19 / 33
  • 52. Clean and Canonical Measures Cleaning algorithm evaluation: 500 clean measures from 25 rules annotated by 3 experts How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
  • 53. Clean and Canonical Measures Cleaning algorithm evaluation: 500 clean measures from 25 rules annotated by 3 experts inter-agreement κ: 0.94 (almost perfect) How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
  • 54. Clean and Canonical Measures Cleaning algorithm evaluation: 500 clean measures from 25 rules annotated by 3 experts inter-agreement κ: 0.94 (almost perfect) baseline = quartile method precision: 0.953 recall: 0.911 How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
  • 55. Clean and Canonical Measures Cleaning algorithm evaluation: 500 clean measures from 25 rules annotated by 3 experts inter-agreement κ: 0.94 (almost perfect) baseline = quartile method precision: 0.953 recall: 0.911 split-and-merge algorithm precision: 0.941 recall: 1.0 How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
  • 56. Clean and Canonical Measures Cleaning algorithm evaluation: 500 clean measures from 25 rules annotated by 3 experts inter-agreement κ: 0.94 (almost perfect) baseline = quartile method precision: 0.953 recall: 0.911 split-and-merge algorithm precision: 0.941 recall: 1.0 remove all disturbed measures How Green are Java Best Practices? GreenDays | 2014-07-01 20 / 33
  • 57. Clean and Canonical Measures Canonical measure: How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
  • 58. Clean and Canonical Measures Canonical measure: time: t3 space: s3 energy: e3 time: t2 space: s2 energy: e2 time: t1 space: s1 energy: e1 How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
  • 59. Clean and Canonical Measures Canonical measure: time: t3 space: s3 energy: e3 time: t2 space: s2 energy: e2 time: t1 space: s1 energy: e1 time: t space: s energy: e How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
  • 60. Clean and Canonical Measures Canonical measure: time: t3 space: s3 energy: e3 time: t2 space: s2 energy: e2 time: t1 space: s1 energy: e1 time: t space: s energy: e How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
  • 61. Clean and Canonical Measures Canonical measure: time: t3 space: s3 energy: e3 time: t2 space: s2 energy: e2 time: t1 space: s1 energy: e1 time: t space: s energy: e How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
  • 62. Clean and Canonical Measures Canonical measure: time: t3 space: s3 energy: e3 time: t2 space: s2 energy: e2 time: t1 space: s1 energy: e1 time: t space: s energy: e error margin: 2% How Green are Java Best Practices? GreenDays | 2014-07-01 21 / 33
  • 63. Code Maturity Code Maturity How many clean measures required for reliable results? How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
  • 64. Code Maturity Code Maturity How many clean measures required for reliable results? 0 20 40 60 80 100 120 5 10 15 Measure Number RelativeStandardDeviation How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
  • 65. Code Maturity Code Maturity How many clean measures required for reliable results? 0 20 40 60 80 100 120 5 10 15 Measure Number RelativeStandardDeviation a set of 25 measures minimum How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
  • 66. Code Maturity Code Maturity How many clean measures required for reliable results? 0 20 40 60 80 100 120 5 10 15 Measure Number RelativeStandardDeviation a set of 25 measures minimum a standard deviation less than 10% How Green are Java Best Practices? GreenDays | 2014-07-01 22 / 33
  • 67. Results Energy in nanojoules, time in nanoseconds Memory in kilobytes Standard Deviation on Energy Replace Object Initialization by Literal Initialization Rule Id GreenEnergy GrayEnergy GreenTime GrayTime GreenMemory GrayMemory GreenStdDev GrayStdDev String 697 7885 842 7827 4136 36104 4.40% 8.14% Float 10311 10448 4736 4127 20032 20032 5.85% 6.58% Integer 685 9575 833 4591 4048 20032 5.21% 6.51% Boolean 683 6267 775 4741 4048 20032 4.77% 7.03% Char 695 33067 840 4595 4048 20032 5.04% 4.65% Double 10003 10210 5810 4270 28032 28032 5.58% 7.83% Long 669 8236 807 6066 4056 28032 2.89% 5.32% Short 680 7819 819 3846 4048 20031 4.87% 7.71% How Green are Java Best Practices? GreenDays | 2014-07-01 23 / 33
  • 68. Results Replace Object Initialization by Literal Initialization Rule Id G reen Energy G ray Energy A bsolute G ain Relative G ain String 697 7885 7188 91.16% Float 10311 10448 137 1.31% Integer 685 9575 8890 92.54% Boolean 683 6267 5584 89.10% Char 695 33067 32372 97.89% Double 10003 10210 207 2.02% Long 669 8236 7567 91.87% Short 680 7819 7139 91.30% How Green are Java Best Practices? GreenDays | 2014-07-01 24 / 33
  • 69. Results Rules for loops A Prefer integer loop counters B Avoid method loop conditions C Prefer comparison-to-0 conditions D Prefer first common condition Id GreenEnergy GrayEnergy GreenTime GrayTime GreenMemory GrayMemory GreenStdDev GrayStdDev A 82 98 4744 5931 16 16 8.66% 7.46% B 8376 8602 6181 6364 20056 20056 3.83% 6.14% C 89 284 4709 17367 16 16 5.09% 5.78% D 97 100 4934 5017 16 16 4.37% 4.60% How Green are Java Best Practices? GreenDays | 2014-07-01 25 / 33
  • 70. Results Rules for loops A Prefer integer loop counters B Avoid method loop conditions C Prefer comparison-to-0 conditions D Prefer first common condition Id G reen Energy G ray Energy A bsolute G ain Relative G ain A 82 98 16 16.32% B 8376 8602 226 2.62% C 89 284 195 68.66% D 97 100 3 3.00% How Green are Java Best Practices? GreenDays | 2014-07-01 25 / 33
  • 71. Results Set String Builder or Buffer Size A String Buffer/Builder capacity initialization B String Buffer/Builder capacity setting C String Buffer/Builder length setting Id GreenEnergy GrayEnergy GreenTime GrayTime GreenMemory GrayMemory GreenStdDev GrayStdDev A 593 1053 38085 59111 52056 73784 7.11% 8.40% B 598 1053 38495 59111 52056 73784 7.86% 8.40% C 1211 1053 59111 70765 73784 104064 8.40% 9.40% A’ 378 899 19278 41088 52056 73784 8.27% 7.18% B’ 429 899 41088 51214 73784 104064 7.18% 5.84% C’ 1043 899 20976 41088 52056 73784 6.01% 7.18% How Green are Java Best Practices? GreenDays | 2014-07-01 26 / 33
  • 72. Results Set String Builder or Buffer Size A String Buffer/Builder capacity initialization B String Buffer/Builder capacity setting C String Buffer/Builder length setting Id G reen Energy G ray Energy A bsolute G ain Relative G ain A 593 1053 460 43.68% B 598 1053 455 43.20% C 1211 1053 -158 -15.00% A’ 378 899 521 57.95% B’ 429 899 470 52.28% C’ 1043 899 -144 -16.01% How Green are Java Best Practices? GreenDays | 2014-07-01 26 / 33
  • 73. Eco-Design Indicators 1 Eco-Design and Best Practices 2 Formalizing Practices 3 Measuring Codes 4 Analyzing Measures, Codes, Practices 5 Eco-Design Indicators Summary Future How Green are Java Best Practices? GreenDays | 2014-07-01 27 / 33
  • 74. Eco-Design Indicators How Green are Java Best Practices? GreenDays | 2014-07-01 28 / 33
  • 75. Eco-Design Indicators Hypothesis Best Coding Practices ≈ Eco-Design Rules 174 formalized and measured rules How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
  • 76. Eco-Design Indicators Hypothesis Best Coding Practices ≈ Eco-Design Rules 174 formalized and measured rules 55% rules huge savings (more than 10%) How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
  • 77. Eco-Design Indicators Hypothesis Best Coding Practices ≈ Eco-Design Rules 174 formalized and measured rules 55% rules huge savings (more than 10%) 20% rules few savings (between 3% and 10%) How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
  • 78. Eco-Design Indicators Hypothesis Best Coding Practices ≈ Eco-Design Rules 174 formalized and measured rules 55% rules huge savings (more than 10%) 20% rules few savings (between 3% and 10%) 15% rules no savings (between -3% and 3%) How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
  • 79. Eco-Design Indicators Hypothesis Best Coding Practices ≈ Eco-Design Rules 174 formalized and measured rules 55% rules huge savings (more than 10%) 20% rules few savings (between 3% and 10%) 15% rules no savings (between -3% and 3%) 10% rules some losses (less than -3%) How Green are Java Best Practices? GreenDays | 2014-07-01 29 / 33
  • 80. Eco-Design Indicators With The Way: 1 reliable measure system How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 81. Eco-Design Indicators With The Way: 1 reliable measure system hybrid physical and logical sensor management How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 82. Eco-Design Indicators With The Way: 1 reliable measure system hybrid physical and logical sensor management complex client/server architecture How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 83. Eco-Design Indicators With The Way: 1 reliable measure system hybrid physical and logical sensor management complex client/server architecture focused star schema database How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 84. Eco-Design Indicators With The Way: 1 reliable measure system hybrid physical and logical sensor management complex client/server architecture focused star schema database robust automatic iterative process How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 85. Eco-Design Indicators With The Way: 1 reliable measure system hybrid physical and logical sensor management complex client/server architecture focused star schema database robust automatic iterative process extensible programming API How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 86. Eco-Design Indicators With The Way: 1 reliable measure system hybrid physical and logical sensor management complex client/server architecture focused star schema database robust automatic iterative process extensible programming API reliable stable measure sets with few measures How Green are Java Best Practices? GreenDays | 2014-07-01 30 / 33
  • 87. Eco-Design Indicators • Jérôme Rocheteau, Virginie Gaillard, et Lamya Belhaj. How Green are Java Best Coding Practices? Proceedings of the 3rd International Conference on Smart Grids and Green IT Systems, pages 235–246. Barcelona, Espagne, Avril 2014. How Green are Java Best Practices? GreenDays | 2014-07-01 31 / 33
  • 88. Future 1 Energy Efficiency Classes? How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 89. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 90. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 91. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings Relative savings How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 92. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings Relative savings 3 Rule indicators in different environments How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 93. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings Relative savings 3 Rule indicators in different environments 4 Rule indicators in different programming languages How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 94. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings Relative savings 3 Rule indicators in different environments 4 Rule indicators in different programming languages 5 Energy efficiency of different programming languages How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 95. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings Relative savings 3 Rule indicators in different environments 4 Rule indicators in different programming languages 5 Energy efficiency of different programming languages 6 Accuracy of different physical and/or logical sensors How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 96. Future 1 Energy Efficiency Classes? 2 Eco-Design Indicators? Absolute savings Relative savings 3 Rule indicators in different environments 4 Rule indicators in different programming languages 5 Energy efficiency of different programming languages 6 Accuracy of different physical and/or logical sensors 7 Energy and memory footprints of logical sensors How Green are Java Best Practices? GreenDays | 2014-07-01 32 / 33
  • 97. Thank you How Green are Java Best Practices? GreenDays | 2014-07-01 33 / 33
  • 98. Data Model How Green are Java Best Practices? GreenDays | 2014-07-01 33 / 33