SlideShare una empresa de Scribd logo
1 de 98
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Curso de Java Persistence API (JPA) (Java EE 7)
Curso de Java Persistence API (JPA) (Java EE 7)Curso de Java Persistence API (JPA) (Java EE 7)
Curso de Java Persistence API (JPA) (Java EE 7)Helder da Rocha
 
PHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object CalisthenicsPHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object CalisthenicsGuilherme Blanco
 
Spark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New YorkSpark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New YorkHolden Karau
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldYura Nosenko
 
서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해중선 곽
 
Curso Java Basico] Aula 19: Vetores (Arrays)
Curso Java Basico] Aula 19:  Vetores (Arrays)Curso Java Basico] Aula 19:  Vetores (Arrays)
Curso Java Basico] Aula 19: Vetores (Arrays)Loiane Groner
 
PHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e QuerystringPHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e QuerystringDaniel Brandão
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkArulalan T
 
Java 8 : Un ch'ti peu de lambda
Java 8 : Un ch'ti peu de lambdaJava 8 : Un ch'ti peu de lambda
Java 8 : Un ch'ti peu de lambdaCh'ti JUG
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Aaron Gustafson
 
Spark Performance Tuning .pdf
Spark Performance Tuning .pdfSpark Performance Tuning .pdf
Spark Performance Tuning .pdfAmit Raj
 
Curso Java Básico Aula 01: Introdução e Dicas para quem está Começando
Curso Java Básico Aula 01: Introdução e Dicas para quem está ComeçandoCurso Java Básico Aula 01: Introdução e Dicas para quem está Começando
Curso Java Básico Aula 01: Introdução e Dicas para quem está ComeçandoLoiane Groner
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfJosé Paumard
 
Time series with Apache Cassandra - Long version
Time series with Apache Cassandra - Long versionTime series with Apache Cassandra - Long version
Time series with Apache Cassandra - Long versionPatrick McFadin
 
Solr 디렉토리 구조와 관리 콘솔
Solr 디렉토리 구조와 관리 콘솔Solr 디렉토리 구조와 관리 콘솔
Solr 디렉토리 구조와 관리 콘솔용호 최
 
KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"
KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"
KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"용근 권
 
파이썬 TDD 101
파이썬 TDD 101파이썬 TDD 101
파이썬 TDD 101정주 김
 
PHP e MySQL para iniciantes
PHP e MySQL para iniciantesPHP e MySQL para iniciantes
PHP e MySQL para iniciantesEduardo Mendes
 

La actualidad más candente (20)

Curso de Java Persistence API (JPA) (Java EE 7)
Curso de Java Persistence API (JPA) (Java EE 7)Curso de Java Persistence API (JPA) (Java EE 7)
Curso de Java Persistence API (JPA) (Java EE 7)
 
Estrutura de Dados em Java (Introdução)
Estrutura de Dados em Java (Introdução)Estrutura de Dados em Java (Introdução)
Estrutura de Dados em Java (Introdução)
 
PHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object CalisthenicsPHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object Calisthenics
 
Spark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New YorkSpark Autotuning Talk - Strata New York
Spark Autotuning Talk - Strata New York
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 world
 
서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해
 
Curso Java Basico] Aula 19: Vetores (Arrays)
Curso Java Basico] Aula 19:  Vetores (Arrays)Curso Java Basico] Aula 19:  Vetores (Arrays)
Curso Java Basico] Aula 19: Vetores (Arrays)
 
Introdução ao TDD
Introdução ao TDDIntrodução ao TDD
Introdução ao TDD
 
PHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e QuerystringPHP Aula 06 - Include, Require e Querystring
PHP Aula 06 - Include, Require e Querystring
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
Java 8 : Un ch'ti peu de lambda
Java 8 : Un ch'ti peu de lambdaJava 8 : Un ch'ti peu de lambda
Java 8 : Un ch'ti peu de lambda
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 
Spark Performance Tuning .pdf
Spark Performance Tuning .pdfSpark Performance Tuning .pdf
Spark Performance Tuning .pdf
 
Curso Java Básico Aula 01: Introdução e Dicas para quem está Começando
Curso Java Básico Aula 01: Introdução e Dicas para quem está ComeçandoCurso Java Básico Aula 01: Introdução e Dicas para quem está Começando
Curso Java Básico Aula 01: Introdução e Dicas para quem está Começando
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdf
 
Time series with Apache Cassandra - Long version
Time series with Apache Cassandra - Long versionTime series with Apache Cassandra - Long version
Time series with Apache Cassandra - Long version
 
Solr 디렉토리 구조와 관리 콘솔
Solr 디렉토리 구조와 관리 콘솔Solr 디렉토리 구조와 관리 콘솔
Solr 디렉토리 구조와 관리 콘솔
 
KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"
KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"
KSUG 스프링캠프 2019 발표자료 - "무엇을 테스트할 것인가, 어떻게 테스트할 것인가"
 
파이썬 TDD 101
파이썬 TDD 101파이썬 TDD 101
파이썬 TDD 101
 
PHP e MySQL para iniciantes
PHP e MySQL para iniciantesPHP e MySQL para iniciantes
PHP e MySQL para iniciantes
 

Destacado

Secure Coding for Java - An introduction
Secure Coding for Java - An introductionSecure Coding for Java - An introduction
Secure Coding for Java - An introductionSebastien Gioria
 
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 LabGreenLabAtDI
 
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 aboutDoug 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 AssessmentPatricia Lago
 
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 DetailsOlivier Philippot
 
Software and Sustainability
Software and SustainabilitySoftware and Sustainability
Software and SustainabilityPatricia Lago
 
說服性科技 Persuasive technology
說服性科技 Persuasive technology說服性科技 Persuasive technology
說服性科技 Persuasive technologyJill 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 2008giosissa
 
Green ICT, sustainability and Open Source
Green ICT, sustainability and Open  SourceGreen ICT, sustainability and Open  Source
Green ICT, sustainability and Open Sourcegiosissa
 

Destacado (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 a How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01

2014 nicta-reproducibility
2014 nicta-reproducibility2014 nicta-reproducibility
2014 nicta-reproducibilityc.titus.brown
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best PracticesSupun 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
 
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 executionAlexander Decker
 
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
 
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 localizationkrws
 
IA3_presentation.pptx
IA3_presentation.pptxIA3_presentation.pptx
IA3_presentation.pptxKtonNguyn2
 
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 TalkCodeOps 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 CloudSigOpt
 
Using the Machine to predict Testability
Using the Machine to predict TestabilityUsing the Machine to predict Testability
Using the Machine to predict TestabilityMiguel Lopez
 
Certified Reasoning for Automated Verification
Certified Reasoning for Automated VerificationCertified Reasoning for Automated Verification
Certified Reasoning for Automated VerificationAsankhaya Sharma
 
Abcd iqs ssoftware-projects-mercecrosas
Abcd iqs ssoftware-projects-mercecrosasAbcd iqs ssoftware-projects-mercecrosas
Abcd iqs ssoftware-projects-mercecrosasMerce Crosas
 
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 reportsGaignard Alban
 
CS3114_09212011.ppt
CS3114_09212011.pptCS3114_09212011.ppt
CS3114_09212011.pptArumugam90
 
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.pdfAayushdigichrome
 
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.pdfAayushdigichrome
 

Similar a 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...
 
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
 
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
 
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
 

Último

Science (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and PitfallsScience (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and PitfallsDobusch Leonhard
 
Introduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptxIntroduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptxMedical College
 
Role of Gibberellins, mode of action and external applications.pptx
Role of Gibberellins, mode of action and external applications.pptxRole of Gibberellins, mode of action and external applications.pptx
Role of Gibberellins, mode of action and external applications.pptxjana861314
 
Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...
Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...
Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...Chiheb Ben Hammouda
 
BACTERIAL SECRETION SYSTEM by Dr. Chayanika Das
BACTERIAL SECRETION SYSTEM by Dr. Chayanika DasBACTERIAL SECRETION SYSTEM by Dr. Chayanika Das
BACTERIAL SECRETION SYSTEM by Dr. Chayanika DasChayanika Das
 
6.2 Pests of Sesame_Identification_Binomics_Dr.UPR
6.2 Pests of Sesame_Identification_Binomics_Dr.UPR6.2 Pests of Sesame_Identification_Binomics_Dr.UPR
6.2 Pests of Sesame_Identification_Binomics_Dr.UPRPirithiRaju
 
Timeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological CorrelationsTimeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological CorrelationsDanielBaumann11
 
Understanding Nutrition, 16th Edition pdf
Understanding Nutrition, 16th Edition pdfUnderstanding Nutrition, 16th Edition pdf
Understanding Nutrition, 16th Edition pdfHabibouKarbo
 
Advances in AI-driven Image Recognition for Early Detection of Cancer
Advances in AI-driven Image Recognition for Early Detection of CancerAdvances in AI-driven Image Recognition for Early Detection of Cancer
Advances in AI-driven Image Recognition for Early Detection of CancerLuis Miguel Chong Chong
 
Introduction of Organ-On-A-Chip - Creative Biolabs
Introduction of Organ-On-A-Chip - Creative BiolabsIntroduction of Organ-On-A-Chip - Creative Biolabs
Introduction of Organ-On-A-Chip - Creative BiolabsCreative-Biolabs
 
FBI Profiling - Forensic Psychology.pptx
FBI Profiling - Forensic Psychology.pptxFBI Profiling - Forensic Psychology.pptx
FBI Profiling - Forensic Psychology.pptxPayal Shrivastava
 
LAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary Microbiology
LAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary MicrobiologyLAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary Microbiology
LAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary MicrobiologyChayanika Das
 
DNA isolation molecular biology practical.pptx
DNA isolation molecular biology practical.pptxDNA isolation molecular biology practical.pptx
DNA isolation molecular biology practical.pptxGiDMOh
 
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdfKDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdfGABYFIORELAMALPARTID1
 
HEMATOPOIESIS - formation of blood cells
HEMATOPOIESIS - formation of blood cellsHEMATOPOIESIS - formation of blood cells
HEMATOPOIESIS - formation of blood cellsSachinSuresh44
 
Interpreting SDSS extragalactic data in the era of JWST
Interpreting SDSS extragalactic data in the era of JWSTInterpreting SDSS extragalactic data in the era of JWST
Interpreting SDSS extragalactic data in the era of JWSTAlexander F. Mayer
 
The Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and FunctionThe Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and FunctionJadeNovelo1
 
bonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girlsbonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girlshansessene
 
Loudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptxLoudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptxpriyankatabhane
 
Immunoblott technique for protein detection.ppt
Immunoblott technique for protein detection.pptImmunoblott technique for protein detection.ppt
Immunoblott technique for protein detection.pptAmirRaziq1
 

Último (20)

Science (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and PitfallsScience (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and Pitfalls
 
Introduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptxIntroduction of Human Body & Structure of cell.pptx
Introduction of Human Body & Structure of cell.pptx
 
Role of Gibberellins, mode of action and external applications.pptx
Role of Gibberellins, mode of action and external applications.pptxRole of Gibberellins, mode of action and external applications.pptx
Role of Gibberellins, mode of action and external applications.pptx
 
Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...
Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...
Efficient Fourier Pricing of Multi-Asset Options: Quasi-Monte Carlo & Domain ...
 
BACTERIAL SECRETION SYSTEM by Dr. Chayanika Das
BACTERIAL SECRETION SYSTEM by Dr. Chayanika DasBACTERIAL SECRETION SYSTEM by Dr. Chayanika Das
BACTERIAL SECRETION SYSTEM by Dr. Chayanika Das
 
6.2 Pests of Sesame_Identification_Binomics_Dr.UPR
6.2 Pests of Sesame_Identification_Binomics_Dr.UPR6.2 Pests of Sesame_Identification_Binomics_Dr.UPR
6.2 Pests of Sesame_Identification_Binomics_Dr.UPR
 
Timeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological CorrelationsTimeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
 
Understanding Nutrition, 16th Edition pdf
Understanding Nutrition, 16th Edition pdfUnderstanding Nutrition, 16th Edition pdf
Understanding Nutrition, 16th Edition pdf
 
Advances in AI-driven Image Recognition for Early Detection of Cancer
Advances in AI-driven Image Recognition for Early Detection of CancerAdvances in AI-driven Image Recognition for Early Detection of Cancer
Advances in AI-driven Image Recognition for Early Detection of Cancer
 
Introduction of Organ-On-A-Chip - Creative Biolabs
Introduction of Organ-On-A-Chip - Creative BiolabsIntroduction of Organ-On-A-Chip - Creative Biolabs
Introduction of Organ-On-A-Chip - Creative Biolabs
 
FBI Profiling - Forensic Psychology.pptx
FBI Profiling - Forensic Psychology.pptxFBI Profiling - Forensic Psychology.pptx
FBI Profiling - Forensic Psychology.pptx
 
LAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary Microbiology
LAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary MicrobiologyLAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary Microbiology
LAMP PCR.pptx by Dr. Chayanika Das, Ph.D, Veterinary Microbiology
 
DNA isolation molecular biology practical.pptx
DNA isolation molecular biology practical.pptxDNA isolation molecular biology practical.pptx
DNA isolation molecular biology practical.pptx
 
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdfKDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
 
HEMATOPOIESIS - formation of blood cells
HEMATOPOIESIS - formation of blood cellsHEMATOPOIESIS - formation of blood cells
HEMATOPOIESIS - formation of blood cells
 
Interpreting SDSS extragalactic data in the era of JWST
Interpreting SDSS extragalactic data in the era of JWSTInterpreting SDSS extragalactic data in the era of JWST
Interpreting SDSS extragalactic data in the era of JWST
 
The Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and FunctionThe Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and Function
 
bonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girlsbonjourmadame.tumblr.com bhaskar's girls
bonjourmadame.tumblr.com bhaskar's girls
 
Loudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptxLoudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptx
 
Immunoblott technique for protein detection.ppt
Immunoblott technique for protein detection.pptImmunoblott technique for protein detection.ppt
Immunoblott technique for protein detection.ppt
 

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