Optimizing the Performance-Related Configurations of Object-Relational Mapping Frameworks Using a Multi-Objective Genetic Algorithm

Optimizing the Performance-RelatedOptimizing the Performance-Related
Configurations of ORM FrameworksConfigurations of ORM Frameworks
Ravjot Singh, Cor-Paul Bezemer,Weiyi Shang,Ahmed E. Hassan
Using a Multi-Objective Genetic AlgorithmUsing a Multi-Objective Genetic Algorithm
2
Configuration is DIFFICULTConfiguration is DIFFICULT
3
27% of customer issues are27% of customer issues are
due to misconfigurationdue to misconfiguration
4
20% of misconfigurations cause20% of misconfigurations cause
performance degradationsperformance degradations
5
A popular online store estimates a $1.6A popular online store estimates a $1.6
billion loss for a 1-second slowdownbillion loss for a 1-second slowdown
6
Databases are at the coreDatabases are at the core
of many large systemsof many large systems
7
Software developers knowSoftware developers know
how to think in objects...how to think in objects...
8
But have less experienceBut have less experience
with databaseswith databases
9
Object-relational mappingObject-relational mapping
(ORM) helps developers(ORM) helps developers
CODE
10
Code without ORM isCode without ORM is
tedioustedious
public class Person {
// ...
public String getName(){
sql = “SELECT name FROM … WHERE …”;
ResultSet rs = stmt.executeQuery(sql);
while(rs.next())
return rs.getString(“name”);
}
}
11
Code with ORM is cleanCode with ORM is clean
@Entity
public class Person {
@Id Integer getId() { ... }
public String getName(){
return this.name;
}
}
12
Several popular ORMSeveral popular ORM
frameworks existframeworks exist
13
ORM has many configurationORM has many configuration
optionsoptions
14
ORM configuration is…ORM configuration is…
guess what?guess what?
15
ORM configuration is…ORM configuration is…
guess what? Difficult!guess what? Difficult!
16
The impact of one ORMThe impact of one ORM
configuration optionconfiguration option
hibernate.max_fetch_depth = {0|1|2|3|...}
17
The impact of one ORMThe impact of one ORM
configuration optionconfiguration option
hibernate.max_fetch_depth = {0|1|2|3|...}
Optimal configuration depends on what you need!
18
Should we care about ORMShould we care about ORM
performance configuration?performance configuration?
Analyze 11 boolean configuration options
hence 211
= 2048 configurations
19
We compare the 'default' withWe compare the 'default' with
the optimal configurationthe optimal configuration
Default configuration
System Tests
Run tests
Default
execution
time
20
We compare the 'default' withWe compare the 'default' with
the optimal configurationthe optimal configuration
Default configuration
System Tests
Run tests
Optimal configuration
System Tests
Default
execution
time
Optimal
execution
time
Run tests
21
We compare the 'default' withWe compare the 'default' with
the optimal configurationthe optimal configuration
Default configuration
System Tests
Run tests
Optimal configuration
System Tests
Compare
Default
execution
time
Optimal
execution
time
Run tests
22
Yes, we should care about ORMYes, we should care about ORM
performance configuration!performance configuration!
89% 96%
of the test cases are significantly
slower using default!
23
How can we guide ORMHow can we guide ORM
performance configuration?performance configuration?
24
Optimize ORM configurationOptimize ORM configuration
by trial-and-errorby trial-and-error
Randomly select
configuration A
25
Optimize ORM configurationOptimize ORM configuration
by trial-and-errorby trial-and-error
Evaluate configuration A
on some workload W
Randomly select
configuration A
26
Optimize ORM configurationOptimize ORM configuration
by trial-and-errorby trial-and-error
Evaluate configuration A
on some workload W
Compare execution time for configuration A
with execution time for current best configuration
Randomly select
configuration A
27
Optimize ORM configurationOptimize ORM configuration
by trial-and-errorby trial-and-error
Evaluate configuration A
on some workload W
Compare execution time for configuration A
with execution time for current best configuration
Randomly select
configuration A
Use best configuration
28
Optimize ORM configurationOptimize ORM configuration
by trial-and-errorby trial-and-error
Evaluate configuration A
on some workload W
Compare execution time for configuration A
with execution time for current best configuration
Randomly select
configuration A
Use best configuration
29
An evolutionary/genetic algorithmAn evolutionary/genetic algorithm
guides this trial-and-error processguides this trial-and-error process
30
Genetic algorithm conceptGenetic algorithm concept
Optimize population based on
one or more objectives
We start from the 'default'
configuration as supplied by
the developer
31
Genetic algorithm conceptGenetic algorithm concept
1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1+
32
Genetic algorithm conceptGenetic algorithm concept
1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1
1 1 0 0 0 0 0 1
+
33
Genetic algorithm conceptGenetic algorithm concept
1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1
1 1 0 0 0 0 0 1
1 1 0 0 0 1 0 1
+
34
Genetic algorithm conceptGenetic algorithm concept
1 1 0 0 0 0 0 0
1 0 0 1 0 0 0 1
1 1 0 0 0 1 0 1
Execution time = 50s
Execution time = 60s
Execution time = 30s
35
Genetic algorithm conceptGenetic algorithm concept
1 1 0 0 0 0 0 0
1 0 0 1 0 0 0 1
1 1 0 0 0 1 0 1
Execution time = 50s
Execution time = 60s
Execution time = 30s
36
Optimizing ORMOptimizing ORM
performance configurationperformance configuration
Objectives:
CPU
Memory
Execution time
37
Optimizing ORMOptimizing ORM
performance configurationperformance configuration
Objectives:
CPU
Memory
Execution time
Calculate Δ with
default configuration
38
Evaluation of our approachEvaluation of our approach
1. Closeness of configurations found by
our approach to the optimal
configuration
2. Speed with which we can find sub-
optimal configurations
39
ExperimentsExperiments
Default configuration
Tests
Repeat 100 times
Optimal configuration
40
Closeness of configurationsCloseness of configurations
to the optimalto the optimal
We rank all existing configurations based on
dominance
Configuration A dominates configuration B if:
1. B is not better than A for all objectives
2.A is better than B for at least one objective
41
Ranking of configurationsRanking of configurations
Configuration CPU usage Memory
usage
Execution time
Default 0 0 0
A +50% +50% 0
B -80% -20% 0
C 0 -80% -20%
42
Ranking of configurationsRanking of configurations
Configuration CPU usage Memory
usage
Execution time
Default 0 0 0
A +50% +50% 0
B -80% -20% 0
C 0 -80% -20%
Rank 1: B and C
Rank 2: default
Rank 3:A
43
The genetic algorithm findsThe genetic algorithm finds
configurations close to the best rankconfigurations close to the best rank
BEST WORST
44
Speed with whichSpeed with which
configurations are foundconfigurations are found
Depends on:
- Workload
- Application
- Data
45
The genetic algorithm findsThe genetic algorithm finds
configurations fast (~5-20 minutes)configurations fast (~5-20 minutes)
46
Yes, we should care about ORMYes, we should care about ORM
performance configuration!performance configuration!
89% 96%
of the test cases are significantly
slower using default!
47
48
How can we guide ORMHow can we guide ORM
performance configuration?performance configuration?
49
50
The genetic algorithm findsThe genetic algorithm finds
configurations close to the optimal rankconfigurations close to the optimal rank
51
52
The genetic algorithm findsThe genetic algorithm finds
configurations fast (~5-20 minutes)configurations fast (~5-20 minutes)
53
54
Cor-Paul Bezemer
bezemer@cs.queensu.ca
http://sailhome.cs.queensu.ca/~corpaul/
55
56
Studied configuration optionsStudied configuration options
order_updates
jdbc.batch_size
order_inserts
connection.release_mode
default_batch_fetch_size
jdbc.batch_versioned_data
max_fetch_depth
id.new_generator_mappings
jdbc.fetch_size
bytecode.use_reflection_optimizer
cache.use_second_level_cache
57
Yes, we should care about ORMYes, we should care about ORM
performance configuration!performance configuration!
1 of 57

Recommended

Performance Regression Analysis: Accomplishments and Challenges by
Performance Regression Analysis: Accomplishments and ChallengesPerformance Regression Analysis: Accomplishments and Challenges
Performance Regression Analysis: Accomplishments and Challengescorpaulbezemer
916 views33 slides
Başarı Hedefli, HORIZON2020 ve TÜBİTAK Destekleri Proje Yazımı - Muzaffer Öztan by
Başarı Hedefli, HORIZON2020 ve TÜBİTAK Destekleri Proje Yazımı - Muzaffer ÖztanBaşarı Hedefli, HORIZON2020 ve TÜBİTAK Destekleri Proje Yazımı - Muzaffer Öztan
Başarı Hedefli, HORIZON2020 ve TÜBİTAK Destekleri Proje Yazımı - Muzaffer ÖztanİTÜ Çekirdek
476 views44 slides
Rioja revision by
Rioja revisionRioja revision
Rioja revisionMarta Alamán
368 views21 slides
SANER 2015 ERA track: Differential Flame Graphs by
SANER 2015 ERA track: Differential Flame GraphsSANER 2015 ERA track: Differential Flame Graphs
SANER 2015 ERA track: Differential Flame Graphscorpaulbezemer
1.9K views17 slides
Logging library migrations - A case study for the Apache Software Foundation ... by
Logging library migrations - A case study for the Apache Software Foundation ...Logging library migrations - A case study for the Apache Software Foundation ...
Logging library migrations - A case study for the Apache Software Foundation ...corpaulbezemer
658 views38 slides
The Impact of Mislabelling on the Performance and Interpretation of Defect Pr... by
The Impact of Mislabelling on the Performance and Interpretation of Defect Pr...The Impact of Mislabelling on the Performance and Interpretation of Defect Pr...
The Impact of Mislabelling on the Performance and Interpretation of Defect Pr...Chakkrit (Kla) Tantithamthavorn
2.4K views74 slides

More Related Content

Viewers also liked

Modular Multi-Objective Genetic Algorithm for Large Scale Bi-level Problems by
Modular Multi-Objective Genetic Algorithm for Large Scale Bi-level ProblemsModular Multi-Objective Genetic Algorithm for Large Scale Bi-level Problems
Modular Multi-Objective Genetic Algorithm for Large Scale Bi-level ProblemsStefano Costanzo
329 views23 slides
Genetic Algorithms for optimization by
Genetic Algorithms for optimizationGenetic Algorithms for optimization
Genetic Algorithms for optimizationFethi Candan
458 views25 slides
A Multi-Objective Genetic Algorithm for Pruning Support Vector Machines by
A Multi-Objective Genetic Algorithm for Pruning Support Vector MachinesA Multi-Objective Genetic Algorithm for Pruning Support Vector Machines
A Multi-Objective Genetic Algorithm for Pruning Support Vector MachinesMohamed Farouk
708 views17 slides
Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag... by
Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag...Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag...
Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag...Masahiro Kanazaki
795 views20 slides
Hype vs. Reality: The AI Explainer by
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
497.8K views28 slides
TEDx Manchester: AI & The Future of Work by
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkVolker Hirsch
902.2K views54 slides

Viewers also liked(6)

Modular Multi-Objective Genetic Algorithm for Large Scale Bi-level Problems by Stefano Costanzo
Modular Multi-Objective Genetic Algorithm for Large Scale Bi-level ProblemsModular Multi-Objective Genetic Algorithm for Large Scale Bi-level Problems
Modular Multi-Objective Genetic Algorithm for Large Scale Bi-level Problems
Stefano Costanzo329 views
Genetic Algorithms for optimization by Fethi Candan
Genetic Algorithms for optimizationGenetic Algorithms for optimization
Genetic Algorithms for optimization
Fethi Candan458 views
A Multi-Objective Genetic Algorithm for Pruning Support Vector Machines by Mohamed Farouk
A Multi-Objective Genetic Algorithm for Pruning Support Vector MachinesA Multi-Objective Genetic Algorithm for Pruning Support Vector Machines
A Multi-Objective Genetic Algorithm for Pruning Support Vector Machines
Mohamed Farouk708 views
Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag... by Masahiro Kanazaki
Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag...Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag...
Multi-objective Genetic Algorithm Applied to Conceptual Design of Single-stag...
Masahiro Kanazaki795 views
Hype vs. Reality: The AI Explainer by Luminary Labs
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs497.8K views
TEDx Manchester: AI & The Future of Work by Volker Hirsch
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of Work
Volker Hirsch902.2K views

Similar to Optimizing the Performance-Related Configurations of Object-Relational Mapping Frameworks Using a Multi-Objective Genetic Algorithm

Icse2018 autonomic by
Icse2018 autonomicIcse2018 autonomic
Icse2018 autonomicConcordia University
275 views37 slides
Bayesian Global Optimization by
Bayesian Global OptimizationBayesian Global Optimization
Bayesian Global OptimizationAmazon Web Services
2.1K views68 slides
Clean & Dirty Acceptance Tests with Cucumber & Watir by
Clean & Dirty Acceptance Tests with Cucumber & WatirClean & Dirty Acceptance Tests with Cucumber & Watir
Clean & Dirty Acceptance Tests with Cucumber & WatirDanny Smith
1.6K views86 slides
Webinar: Does Your Data Center Need NVMe? by
Webinar: Does Your Data Center Need NVMe?Webinar: Does Your Data Center Need NVMe?
Webinar: Does Your Data Center Need NVMe?Storage Switzerland
175 views24 slides
Dev confus.2020 compliance operator by
Dev confus.2020 compliance operatorDev confus.2020 compliance operator
Dev confus.2020 compliance operatorjaormx
670 views48 slides
Fuzzy logic by
Fuzzy logicFuzzy logic
Fuzzy logicMahesh Vadhavaniya profmjv
2.6K views37 slides

Similar to Optimizing the Performance-Related Configurations of Object-Relational Mapping Frameworks Using a Multi-Objective Genetic Algorithm(20)

Clean & Dirty Acceptance Tests with Cucumber & Watir by Danny Smith
Clean & Dirty Acceptance Tests with Cucumber & WatirClean & Dirty Acceptance Tests with Cucumber & Watir
Clean & Dirty Acceptance Tests with Cucumber & Watir
Danny Smith1.6K views
Dev confus.2020 compliance operator by jaormx
Dev confus.2020 compliance operatorDev confus.2020 compliance operator
Dev confus.2020 compliance operator
jaormx670 views
Continuous Performance Testing for Microservices by Vincenzo Ferme
Continuous Performance Testing for MicroservicesContinuous Performance Testing for Microservices
Continuous Performance Testing for Microservices
Vincenzo Ferme644 views
MLConf 2016 SigOpt Talk by Scott Clark by SigOpt
MLConf 2016 SigOpt Talk by Scott ClarkMLConf 2016 SigOpt Talk by Scott Clark
MLConf 2016 SigOpt Talk by Scott Clark
SigOpt1.3K views
Scott Clark, Co-Founder and CEO, SigOpt at MLconf SF 2016 by MLconf
Scott Clark, Co-Founder and CEO, SigOpt at MLconf SF 2016Scott Clark, Co-Founder and CEO, SigOpt at MLconf SF 2016
Scott Clark, Co-Founder and CEO, SigOpt at MLconf SF 2016
MLconf1.7K views
Cim Automation 0909 Xx (Linkedin) by JovanZ
Cim Automation 0909 Xx (Linkedin)Cim Automation 0909 Xx (Linkedin)
Cim Automation 0909 Xx (Linkedin)
JovanZ300 views
ICSE2014 by swy351
ICSE2014ICSE2014
ICSE2014
swy35135.1K views
TEST EXECUTION AND REPORTING by suhasreddy1
TEST EXECUTION AND REPORTINGTEST EXECUTION AND REPORTING
TEST EXECUTION AND REPORTING
suhasreddy123.7K views
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data by Mail.ru Group
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough dataВладимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
Владимир Гулин, Mail.Ru Group, Learning to rank using clickthrough data
Mail.ru Group6.8K views
Database Performance Tuning Introduction by MyOnlineITCourses
Database  Performance Tuning IntroductionDatabase  Performance Tuning Introduction
Database Performance Tuning Introduction
MyOnlineITCourses13.1K views
SOFTWARE ENGINEERING UNIT 6 Ch 13 by Azhar Shaik
SOFTWARE ENGINEERING UNIT 6 Ch 13SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13
Azhar Shaik536 views

Recently uploaded

Gold Nanoparticle as novel Agent for Drug targeting (1).pptx by
Gold Nanoparticle as novel Agent for Drug targeting (1).pptxGold Nanoparticle as novel Agent for Drug targeting (1).pptx
Gold Nanoparticle as novel Agent for Drug targeting (1).pptxsakshijadhav9843
18 views13 slides
CSF -SHEEBA.D presentation.pptx by
CSF -SHEEBA.D presentation.pptxCSF -SHEEBA.D presentation.pptx
CSF -SHEEBA.D presentation.pptxSheebaD7
10 views13 slides
journal of engineering and applied science.pdf by
journal of engineering and applied science.pdfjournal of engineering and applied science.pdf
journal of engineering and applied science.pdfKSAravindSrivastava
7 views7 slides
How to be(come) a successful PhD student by
How to be(come) a successful PhD studentHow to be(come) a successful PhD student
How to be(come) a successful PhD studentTom Mens
422 views62 slides
RemeOs science and clinical evidence by
RemeOs science and clinical evidenceRemeOs science and clinical evidence
RemeOs science and clinical evidencePetrusViitanen1
26 views96 slides
Batrachospermum.pptx by
Batrachospermum.pptxBatrachospermum.pptx
Batrachospermum.pptxnisarahmad632316
31 views37 slides

Recently uploaded(20)

Gold Nanoparticle as novel Agent for Drug targeting (1).pptx by sakshijadhav9843
Gold Nanoparticle as novel Agent for Drug targeting (1).pptxGold Nanoparticle as novel Agent for Drug targeting (1).pptx
Gold Nanoparticle as novel Agent for Drug targeting (1).pptx
sakshijadhav984318 views
CSF -SHEEBA.D presentation.pptx by SheebaD7
CSF -SHEEBA.D presentation.pptxCSF -SHEEBA.D presentation.pptx
CSF -SHEEBA.D presentation.pptx
SheebaD710 views
How to be(come) a successful PhD student by Tom Mens
How to be(come) a successful PhD studentHow to be(come) a successful PhD student
How to be(come) a successful PhD student
Tom Mens422 views
RemeOs science and clinical evidence by PetrusViitanen1
RemeOs science and clinical evidenceRemeOs science and clinical evidence
RemeOs science and clinical evidence
PetrusViitanen126 views
Open Access Publishing in Astrophysics by Peter Coles
Open Access Publishing in AstrophysicsOpen Access Publishing in Astrophysics
Open Access Publishing in Astrophysics
Peter Coles543 views
ENTOMOLOGY PPT ON BOMBYCIDAE AND SATURNIIDAE.pptx by MN
ENTOMOLOGY PPT ON BOMBYCIDAE AND SATURNIIDAE.pptxENTOMOLOGY PPT ON BOMBYCIDAE AND SATURNIIDAE.pptx
ENTOMOLOGY PPT ON BOMBYCIDAE AND SATURNIIDAE.pptx
MN6 views
Metatheoretical Panda-Samaneh Borji.pdf by samanehborji
Metatheoretical Panda-Samaneh Borji.pdfMetatheoretical Panda-Samaneh Borji.pdf
Metatheoretical Panda-Samaneh Borji.pdf
samanehborji16 views
Company Fashion Show ChemAI 231116.pptx by Marco Tibaldi
Company Fashion Show ChemAI 231116.pptxCompany Fashion Show ChemAI 231116.pptx
Company Fashion Show ChemAI 231116.pptx
Marco Tibaldi74 views
"How can I develop my learning path in bioinformatics? by Bioinformy
"How can I develop my learning path in bioinformatics?"How can I develop my learning path in bioinformatics?
"How can I develop my learning path in bioinformatics?
Bioinformy18 views
A training, certification and marketing scheme for informal dairy vendors in ... by ILRI
A training, certification and marketing scheme for informal dairy vendors in ...A training, certification and marketing scheme for informal dairy vendors in ...
A training, certification and marketing scheme for informal dairy vendors in ...
ILRI10 views
Guinea Pig as a Model for Translation Research by PervaizDar1
Guinea Pig as a Model for Translation ResearchGuinea Pig as a Model for Translation Research
Guinea Pig as a Model for Translation Research
PervaizDar111 views
domestic waste_100013.pptx by padmasriv25
domestic waste_100013.pptxdomestic waste_100013.pptx
domestic waste_100013.pptx
padmasriv2511 views
Types of Fluids - Newtonian and Non Newtonian Fluids in Continuous Culture Fe... by Pavithra B R
Types of Fluids - Newtonian and Non Newtonian Fluids in Continuous Culture Fe...Types of Fluids - Newtonian and Non Newtonian Fluids in Continuous Culture Fe...
Types of Fluids - Newtonian and Non Newtonian Fluids in Continuous Culture Fe...
Pavithra B R12 views
Pollination By Nagapradheesh.M.pptx by MNAGAPRADHEESH
Pollination By Nagapradheesh.M.pptxPollination By Nagapradheesh.M.pptx
Pollination By Nagapradheesh.M.pptx
MNAGAPRADHEESH15 views
himalay baruah acid fast staining.pptx by HimalayBaruah
himalay baruah acid fast staining.pptxhimalay baruah acid fast staining.pptx
himalay baruah acid fast staining.pptx
HimalayBaruah5 views

Optimizing the Performance-Related Configurations of Object-Relational Mapping Frameworks Using a Multi-Objective Genetic Algorithm

  • 1. Optimizing the Performance-RelatedOptimizing the Performance-Related Configurations of ORM FrameworksConfigurations of ORM Frameworks Ravjot Singh, Cor-Paul Bezemer,Weiyi Shang,Ahmed E. Hassan Using a Multi-Objective Genetic AlgorithmUsing a Multi-Objective Genetic Algorithm
  • 3. 3 27% of customer issues are27% of customer issues are due to misconfigurationdue to misconfiguration
  • 4. 4 20% of misconfigurations cause20% of misconfigurations cause performance degradationsperformance degradations
  • 5. 5 A popular online store estimates a $1.6A popular online store estimates a $1.6 billion loss for a 1-second slowdownbillion loss for a 1-second slowdown
  • 6. 6 Databases are at the coreDatabases are at the core of many large systemsof many large systems
  • 7. 7 Software developers knowSoftware developers know how to think in objects...how to think in objects...
  • 8. 8 But have less experienceBut have less experience with databaseswith databases
  • 9. 9 Object-relational mappingObject-relational mapping (ORM) helps developers(ORM) helps developers CODE
  • 10. 10 Code without ORM isCode without ORM is tedioustedious public class Person { // ... public String getName(){ sql = “SELECT name FROM … WHERE …”; ResultSet rs = stmt.executeQuery(sql); while(rs.next()) return rs.getString(“name”); } }
  • 11. 11 Code with ORM is cleanCode with ORM is clean @Entity public class Person { @Id Integer getId() { ... } public String getName(){ return this.name; } }
  • 12. 12 Several popular ORMSeveral popular ORM frameworks existframeworks exist
  • 13. 13 ORM has many configurationORM has many configuration optionsoptions
  • 14. 14 ORM configuration is…ORM configuration is… guess what?guess what?
  • 15. 15 ORM configuration is…ORM configuration is… guess what? Difficult!guess what? Difficult!
  • 16. 16 The impact of one ORMThe impact of one ORM configuration optionconfiguration option hibernate.max_fetch_depth = {0|1|2|3|...}
  • 17. 17 The impact of one ORMThe impact of one ORM configuration optionconfiguration option hibernate.max_fetch_depth = {0|1|2|3|...} Optimal configuration depends on what you need!
  • 18. 18 Should we care about ORMShould we care about ORM performance configuration?performance configuration? Analyze 11 boolean configuration options hence 211 = 2048 configurations
  • 19. 19 We compare the 'default' withWe compare the 'default' with the optimal configurationthe optimal configuration Default configuration System Tests Run tests Default execution time
  • 20. 20 We compare the 'default' withWe compare the 'default' with the optimal configurationthe optimal configuration Default configuration System Tests Run tests Optimal configuration System Tests Default execution time Optimal execution time Run tests
  • 21. 21 We compare the 'default' withWe compare the 'default' with the optimal configurationthe optimal configuration Default configuration System Tests Run tests Optimal configuration System Tests Compare Default execution time Optimal execution time Run tests
  • 22. 22 Yes, we should care about ORMYes, we should care about ORM performance configuration!performance configuration! 89% 96% of the test cases are significantly slower using default!
  • 23. 23 How can we guide ORMHow can we guide ORM performance configuration?performance configuration?
  • 24. 24 Optimize ORM configurationOptimize ORM configuration by trial-and-errorby trial-and-error Randomly select configuration A
  • 25. 25 Optimize ORM configurationOptimize ORM configuration by trial-and-errorby trial-and-error Evaluate configuration A on some workload W Randomly select configuration A
  • 26. 26 Optimize ORM configurationOptimize ORM configuration by trial-and-errorby trial-and-error Evaluate configuration A on some workload W Compare execution time for configuration A with execution time for current best configuration Randomly select configuration A
  • 27. 27 Optimize ORM configurationOptimize ORM configuration by trial-and-errorby trial-and-error Evaluate configuration A on some workload W Compare execution time for configuration A with execution time for current best configuration Randomly select configuration A Use best configuration
  • 28. 28 Optimize ORM configurationOptimize ORM configuration by trial-and-errorby trial-and-error Evaluate configuration A on some workload W Compare execution time for configuration A with execution time for current best configuration Randomly select configuration A Use best configuration
  • 29. 29 An evolutionary/genetic algorithmAn evolutionary/genetic algorithm guides this trial-and-error processguides this trial-and-error process
  • 30. 30 Genetic algorithm conceptGenetic algorithm concept Optimize population based on one or more objectives We start from the 'default' configuration as supplied by the developer
  • 31. 31 Genetic algorithm conceptGenetic algorithm concept 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1+
  • 32. 32 Genetic algorithm conceptGenetic algorithm concept 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 +
  • 33. 33 Genetic algorithm conceptGenetic algorithm concept 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 0 1 +
  • 34. 34 Genetic algorithm conceptGenetic algorithm concept 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 Execution time = 50s Execution time = 60s Execution time = 30s
  • 35. 35 Genetic algorithm conceptGenetic algorithm concept 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 Execution time = 50s Execution time = 60s Execution time = 30s
  • 36. 36 Optimizing ORMOptimizing ORM performance configurationperformance configuration Objectives: CPU Memory Execution time
  • 37. 37 Optimizing ORMOptimizing ORM performance configurationperformance configuration Objectives: CPU Memory Execution time Calculate Δ with default configuration
  • 38. 38 Evaluation of our approachEvaluation of our approach 1. Closeness of configurations found by our approach to the optimal configuration 2. Speed with which we can find sub- optimal configurations
  • 40. 40 Closeness of configurationsCloseness of configurations to the optimalto the optimal We rank all existing configurations based on dominance Configuration A dominates configuration B if: 1. B is not better than A for all objectives 2.A is better than B for at least one objective
  • 41. 41 Ranking of configurationsRanking of configurations Configuration CPU usage Memory usage Execution time Default 0 0 0 A +50% +50% 0 B -80% -20% 0 C 0 -80% -20%
  • 42. 42 Ranking of configurationsRanking of configurations Configuration CPU usage Memory usage Execution time Default 0 0 0 A +50% +50% 0 B -80% -20% 0 C 0 -80% -20% Rank 1: B and C Rank 2: default Rank 3:A
  • 43. 43 The genetic algorithm findsThe genetic algorithm finds configurations close to the best rankconfigurations close to the best rank BEST WORST
  • 44. 44 Speed with whichSpeed with which configurations are foundconfigurations are found Depends on: - Workload - Application - Data
  • 45. 45 The genetic algorithm findsThe genetic algorithm finds configurations fast (~5-20 minutes)configurations fast (~5-20 minutes)
  • 46. 46 Yes, we should care about ORMYes, we should care about ORM performance configuration!performance configuration! 89% 96% of the test cases are significantly slower using default!
  • 47. 47
  • 48. 48 How can we guide ORMHow can we guide ORM performance configuration?performance configuration?
  • 49. 49
  • 50. 50 The genetic algorithm findsThe genetic algorithm finds configurations close to the optimal rankconfigurations close to the optimal rank
  • 51. 51
  • 52. 52 The genetic algorithm findsThe genetic algorithm finds configurations fast (~5-20 minutes)configurations fast (~5-20 minutes)
  • 53. 53
  • 55. 55
  • 56. 56 Studied configuration optionsStudied configuration options order_updates jdbc.batch_size order_inserts connection.release_mode default_batch_fetch_size jdbc.batch_versioned_data max_fetch_depth id.new_generator_mappings jdbc.fetch_size bytecode.use_reflection_optimizer cache.use_second_level_cache
  • 57. 57 Yes, we should care about ORMYes, we should care about ORM performance configuration!performance configuration!