SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Detecting Performance Anti-patterns for
Applications Developed Using
Object-Relational Mapping
1
Mohamed Nasser, Parminder Flora
Tse-Hsun(Peter) Chen Ahmed E. HassanWeiyi Shang Zhen Ming Jiang
Databases are essential in large-scale
software systems
2
Database
3
Application developers work with objects
More intuitive if we can
map objects directly to DB
4
Object-Relational Mapping eliminates
the gap between objects and SQL
Database
• Lots of boilerplate code
• Need to manage object-DB
translations manually
Object
Classes
Problem of using raw SQLs
ORM
Much less code and shorter
development time
ORM is widely used in practice
5
• Java Hibernate has more than 8
million downloads
• In 2013, 15% of the 17,000 Java
developer jobs require ORM
experience (dice.com)
Different ORM technologies
An example class with ORM code
6
@Entity
@Table(name = “user”)
public class User{
@Column(name=“id”)
private int id;
@Column(name=“name”)
String userName;
@OneToMany(fetch=FetchType.EAGER)
List<Team> teams;
public void setName(String n){
userName = n
}
… other getter and setter methods
User.javaUser class is
mapped to “user”
table in DB
id is mapped to the
column “id” in the
user table
A user can belong
to multiple teams
Eagerly retrieve
associated teams
when retrieving a
user object
Accessing the database using ORM
7
User u = findUserByID(1);
ORM
database
select u from user
where u.id = 1;
u.setName(“Peter”);
update user set
name=“Peter”
where user.id = 1;
Objects SQLs
Developers may not be aware of
database access
Wow! I don’t
need to worry
about DB code!
ORM code with
performance anti-patterns
8
Bad system
performance
The performance difference can be LARGE!
Performance anti-pattern
detection framework
Performance anti-pattern detection and
ranking framework
Ranked according to
performance impact
Ranked
Performance
anti-patterns
Source
Code
detection
ranking
9
Performance anti-pattern
detection framework
Performance anti-pattern detection and
ranking framework
Ranked according to
performance impact
Ranked
Performance
anti-patterns
Source
Code
detection
ranking
10
Discuss only one anti-pattern
in the presentation
(more patterns in the paper)
ORM excessive data anti-pattern
Class User{
@EAGER
List<Team> teams;
}
User u = findUserById(1);
u.getName();
EOF
11
Objects
SQL
Eagerly retrieve
teams from DB
User Table Team Table
join Team data is never
used!
Detecting excessive data
using static analysis
12
First find all the objects that
eagerly retrieve data from DB
Class User{
@EAGER
List<Team> teams;
}
Identify all the data usages of
objects
User user = findUserByID(1);
Check if the retrieved data is ever
used
user.getName();
user team
user team
Performance anti-pattern
detection framework
Performance anti-pattern detection and
ranking framework
Ranked according to
performance impact
Ranked
Performance
anti-patterns
Source
Code
detection
ranking
13
Performance anti-pattern
detection framework
Performance anti-pattern detection and
ranking framework
Ranked according to
performance impact
Ranked
Performance
anti-patterns
Source
Code
detection
ranking
14
Performance anti-patterns have
different impacts
15
User user_in_1_team = findUserByID(1);
Retrieving 1 user and 1 team
User user_in_100_teams = findUserByID(100);
Retrieving 1 user and 100 teams!
One can only reveal performance
impact by execution
Measuring the impact using repeated
measurements and effect sizes
16
We use effect sizes (Cohen’s D) to measure
the performance impact
Effect sizes =
We repeat each test 30 times to obtain stable
measurement results
Size of performance impact is not defined:
Performance measurements are unstable:
Studied systems and detection results
Large open-source
e-commence system
> 1,700 files
> 206K LOC
Enterprise system
> 3,000 files
> 300K LOC
Spring open-source system
Online system for a pet clinic
51 files
3.3K LOC
482 excessive data > 10 excessive data 10 excessive data
17
Performance impact
Research questions
Ranks of the anti-patterns at
different scales
18
Performance impact
Research questions
Ranks of the anti-patterns at
different scales
19
Assessing anti-pattern impact by
fixing the anti-patterns
Execution
Response timeuser.getName()
Code with
anti-patterns
fetchType.set(LAZY)
user.getName()
Code without
anti-patterns
20
Execute test
suite 30 times
Response time
after fixing the
anti-patterns
Avg. %
improvement and
effect sizes
Execution
Execute test
suite 30 times
Performance anti-patterns have
medium to large effect sizes
0%
20%
40%
60%
80%
100%
Excessive Data
BL
EA
PC
21
%improvementinresponsetime
large
effect size
large
effect size medium
effect size
Performance impact
Research questions
Ranks of the anti-patterns at
different scales
22
Removing anti-pattern
improves response by ~35%
Performance impact
Research questions
Ranks of the anti-patterns at
different scales
23
Removing anti-pattern
improves response by ~35%
Performance problems usually arise
under large load
24
Performance problems revealed at
small scales may be more serious
25
We should first fix the anti-patterns that
have larger effects at smaller scales
Input scales may have
exponential effects on
performance
Different input scales Performance at
different input scales
Comparing ranked anti-patterns at
different data scales
26
Ranked
Performance
anti-patterns
from small data
detection
ranking
Ranked
Performance
anti-patterns
from large data
?
Small size input
Large size input
Anti-patterns have large effects on
performance even at smaller data scales
27
0
10
20
30
40
50
0
1
2
3
4
5
Effectsize
Effect sizes and the ranks of the anti-patterns
are consistent in different data scales
Performance impact
Research questions
Ranks of the anti-patterns at
different scales
28
Removing anti-pattern
improves response by ~35%
Ranks of the anti-patterns
are consistent in different
data scales
29
30
31
32
33
tsehsun@cs.queensu.ca

Weitere ähnliche Inhalte

Was ist angesagt?

Icse2014 v3
Icse2014 v3Icse2014 v3
Icse2014 v3SAIL_QU
 
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...Concordia University
 
Testclass [Autosaved]
Testclass [Autosaved]Testclass [Autosaved]
Testclass [Autosaved]Suraj Singh
 
Software Mining and Software Datasets
Software Mining and Software DatasetsSoftware Mining and Software Datasets
Software Mining and Software DatasetsTao Xie
 
Software Analytics: Towards Software Mining that Matters
Software Analytics: Towards Software Mining that MattersSoftware Analytics: Towards Software Mining that Matters
Software Analytics: Towards Software Mining that MattersTao Xie
 
Automating the process of continuously prioritising data, updating and deploy...
Automating the process of continuously prioritising data, updating and deploy...Automating the process of continuously prioritising data, updating and deploy...
Automating the process of continuously prioritising data, updating and deploy...Ola Spjuth
 
Certification preparation - Error Handling and Troubleshooting recap.pptx
Certification preparation - Error Handling and Troubleshooting recap.pptxCertification preparation - Error Handling and Troubleshooting recap.pptx
Certification preparation - Error Handling and Troubleshooting recap.pptxRohit Radhakrishnan
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath CommunityRohit Radhakrishnan
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxRohit Radhakrishnan
 
Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...
Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...
Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...Lucidworks
 
Automated parameter optimization should be included in future 
defect predict...
Automated parameter optimization should be included in future 
defect predict...Automated parameter optimization should be included in future 
defect predict...
Automated parameter optimization should be included in future 
defect predict...Chakkrit (Kla) Tantithamthavorn
 
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For TestingHenk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For TestingTEST Huddle
 
Scenario $4$
Scenario $4$Scenario $4$
Scenario $4$Jason121
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringTao Xie
 
Best Great Ideas on Java Research Papers
Best Great Ideas on Java Research PapersBest Great Ideas on Java Research Papers
Best Great Ideas on Java Research Paperssuzanneriverabme
 
Making solubility models with reaxy
Making solubility models with reaxyMaking solubility models with reaxy
Making solubility models with reaxyAnn-Marie Roche
 
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...STePINForum
 
efficient prediction of difficult keyword queries over databases
efficient prediction of difficult keyword queries over databasesefficient prediction of difficult keyword queries over databases
efficient prediction of difficult keyword queries over databasesswathi78
 
professional fuzzy type-ahead rummage around in xml type-ahead search techni...
professional fuzzy type-ahead rummage around in xml  type-ahead search techni...professional fuzzy type-ahead rummage around in xml  type-ahead search techni...
professional fuzzy type-ahead rummage around in xml type-ahead search techni...Kumar Goud
 
NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...Nicholas Glattard
 

Was ist angesagt? (20)

Icse2014 v3
Icse2014 v3Icse2014 v3
Icse2014 v3
 
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
 
Testclass [Autosaved]
Testclass [Autosaved]Testclass [Autosaved]
Testclass [Autosaved]
 
Software Mining and Software Datasets
Software Mining and Software DatasetsSoftware Mining and Software Datasets
Software Mining and Software Datasets
 
Software Analytics: Towards Software Mining that Matters
Software Analytics: Towards Software Mining that MattersSoftware Analytics: Towards Software Mining that Matters
Software Analytics: Towards Software Mining that Matters
 
Automating the process of continuously prioritising data, updating and deploy...
Automating the process of continuously prioritising data, updating and deploy...Automating the process of continuously prioritising data, updating and deploy...
Automating the process of continuously prioritising data, updating and deploy...
 
Certification preparation - Error Handling and Troubleshooting recap.pptx
Certification preparation - Error Handling and Troubleshooting recap.pptxCertification preparation - Error Handling and Troubleshooting recap.pptx
Certification preparation - Error Handling and Troubleshooting recap.pptx
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptx
 
Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...
Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...
Automatically Build Solr Synonyms List using Machine Learning - Chao Han, Luc...
 
Automated parameter optimization should be included in future 
defect predict...
Automated parameter optimization should be included in future 
defect predict...Automated parameter optimization should be included in future 
defect predict...
Automated parameter optimization should be included in future 
defect predict...
 
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For TestingHenk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
 
Scenario $4$
Scenario $4$Scenario $4$
Scenario $4$
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software Engineering
 
Best Great Ideas on Java Research Papers
Best Great Ideas on Java Research PapersBest Great Ideas on Java Research Papers
Best Great Ideas on Java Research Papers
 
Making solubility models with reaxy
Making solubility models with reaxyMaking solubility models with reaxy
Making solubility models with reaxy
 
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
 
efficient prediction of difficult keyword queries over databases
efficient prediction of difficult keyword queries over databasesefficient prediction of difficult keyword queries over databases
efficient prediction of difficult keyword queries over databases
 
professional fuzzy type-ahead rummage around in xml type-ahead search techni...
professional fuzzy type-ahead rummage around in xml  type-ahead search techni...professional fuzzy type-ahead rummage around in xml  type-ahead search techni...
professional fuzzy type-ahead rummage around in xml type-ahead search techni...
 
NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...
 

Andere mochten auch

5 Anti-Patterns in Api Design - buildstuff
5 Anti-Patterns in Api Design - buildstuff5 Anti-Patterns in Api Design - buildstuff
5 Anti-Patterns in Api Design - buildstuffAli Kheyrollahi
 
Patterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsPatterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsStrongback Consulting
 
APIs: the Glue of Cloud Computing
APIs: the Glue of Cloud ComputingAPIs: the Glue of Cloud Computing
APIs: the Glue of Cloud Computing3scale
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Cesare Pautasso
 
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...Spark Summit
 
WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful ServicesCesare Pautasso
 
Antipatrones de Software
Antipatrones de SoftwareAntipatrones de Software
Antipatrones de SoftwareMartin Salias
 
Antipatrones de desarrollo de software
Antipatrones de desarrollo de softwareAntipatrones de desarrollo de software
Antipatrones de desarrollo de softwarePablo Bouzada
 
ICSE2014
ICSE2014ICSE2014
ICSE2014swy351
 
Opensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN StackOpensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN StackPedro J. Molina
 
Api anti patterns
Api anti patternsApi anti patterns
Api anti patternsMike Pearce
 

Andere mochten auch (12)

5 Anti-Patterns in Api Design - buildstuff
5 Anti-Patterns in Api Design - buildstuff5 Anti-Patterns in Api Design - buildstuff
5 Anti-Patterns in Api Design - buildstuff
 
Patterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsPatterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps Tools
 
APIs: the Glue of Cloud Computing
APIs: the Glue of Cloud ComputingAPIs: the Glue of Cloud Computing
APIs: the Glue of Cloud Computing
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
 
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
 
WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful Services
 
Antipatrones de Software
Antipatrones de SoftwareAntipatrones de Software
Antipatrones de Software
 
Anti patrones
Anti patronesAnti patrones
Anti patrones
 
Antipatrones de desarrollo de software
Antipatrones de desarrollo de softwareAntipatrones de desarrollo de software
Antipatrones de desarrollo de software
 
ICSE2014
ICSE2014ICSE2014
ICSE2014
 
Opensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN StackOpensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN Stack
 
Api anti patterns
Api anti patternsApi anti patterns
Api anti patterns
 

Ähnlich wie ICSE2014 - Detecting Performance Anti-patterns for Applications Developed using Object-Relational Mapping

Mechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and ResponseMechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and ResponseAshish Kamra
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSung Kim
 
Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...SAIL_QU
 
Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...SAIL_QU
 
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...Concordia University
 
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения..."Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...Yandex
 
Fast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approachFast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approachYury Leonychev
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataCory Foy
 
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...Simplilearn
 
What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?Matei Zaharia
 
52 - The Impact of Test Ownership and Team Structure on the Reliability and E...
52 - The Impact of Test Ownership and Team Structure on the Reliability and E...52 - The Impact of Test Ownership and Team Structure on the Reliability and E...
52 - The Impact of Test Ownership and Team Structure on the Reliability and E...ESEM 2014
 
Agile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tddAgile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tddSrinivasa GV
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databasesAlessandro Alpi
 
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...QBiC_Tue
 
Latest .Net Questions and Answers
Latest .Net Questions and Answers Latest .Net Questions and Answers
Latest .Net Questions and Answers Narasimhulu Palle
 
B2 2005 introduction_load_testing_blackboard_primer_draft
B2 2005 introduction_load_testing_blackboard_primer_draftB2 2005 introduction_load_testing_blackboard_primer_draft
B2 2005 introduction_load_testing_blackboard_primer_draftSteve Feldman
 

Ähnlich wie ICSE2014 - Detecting Performance Anti-patterns for Applications Developed using Object-Relational Mapping (20)

Mechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and ResponseMechanisms for Database Intrusion Detection and Response
Mechanisms for Database Intrusion Detection and Response
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
 
Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...
 
Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...Improving the quality of large scale database-centric software systems by ana...
Improving the quality of large scale database-centric software systems by ana...
 
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
 
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения..."Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
"Быстрое обнаружение вредоносного ПО для Android с помощью машинного обучения...
 
Fast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approachFast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approach
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and Data
 
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
 
What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?What are the Unique Challenges and Opportunities in Systems for ML?
What are the Unique Challenges and Opportunities in Systems for ML?
 
Test data generation
Test data generationTest data generation
Test data generation
 
52 - The Impact of Test Ownership and Team Structure on the Reliability and E...
52 - The Impact of Test Ownership and Team Structure on the Reliability and E...52 - The Impact of Test Ownership and Team Structure on the Reliability and E...
52 - The Impact of Test Ownership and Team Structure on the Reliability and E...
 
Agile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tddAgile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tdd
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
 
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
Data Management for Quantitative Biology - Database Systems (continued) LIMS ...
 
Effective unit testing
Effective unit testingEffective unit testing
Effective unit testing
 
STRICT-SANER2017
STRICT-SANER2017STRICT-SANER2017
STRICT-SANER2017
 
Latest .Net Questions and Answers
Latest .Net Questions and Answers Latest .Net Questions and Answers
Latest .Net Questions and Answers
 
Dev411
Dev411Dev411
Dev411
 
B2 2005 introduction_load_testing_blackboard_primer_draft
B2 2005 introduction_load_testing_blackboard_primer_draftB2 2005 introduction_load_testing_blackboard_primer_draft
B2 2005 introduction_load_testing_blackboard_primer_draft
 

Kürzlich hochgeladen

Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Kürzlich hochgeladen (20)

Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

ICSE2014 - Detecting Performance Anti-patterns for Applications Developed using Object-Relational Mapping

  • 1. Detecting Performance Anti-patterns for Applications Developed Using Object-Relational Mapping 1 Mohamed Nasser, Parminder Flora Tse-Hsun(Peter) Chen Ahmed E. HassanWeiyi Shang Zhen Ming Jiang
  • 2. Databases are essential in large-scale software systems 2 Database
  • 3. 3 Application developers work with objects More intuitive if we can map objects directly to DB
  • 4. 4 Object-Relational Mapping eliminates the gap between objects and SQL Database • Lots of boilerplate code • Need to manage object-DB translations manually Object Classes Problem of using raw SQLs ORM Much less code and shorter development time
  • 5. ORM is widely used in practice 5 • Java Hibernate has more than 8 million downloads • In 2013, 15% of the 17,000 Java developer jobs require ORM experience (dice.com) Different ORM technologies
  • 6. An example class with ORM code 6 @Entity @Table(name = “user”) public class User{ @Column(name=“id”) private int id; @Column(name=“name”) String userName; @OneToMany(fetch=FetchType.EAGER) List<Team> teams; public void setName(String n){ userName = n } … other getter and setter methods User.javaUser class is mapped to “user” table in DB id is mapped to the column “id” in the user table A user can belong to multiple teams Eagerly retrieve associated teams when retrieving a user object
  • 7. Accessing the database using ORM 7 User u = findUserByID(1); ORM database select u from user where u.id = 1; u.setName(“Peter”); update user set name=“Peter” where user.id = 1; Objects SQLs
  • 8. Developers may not be aware of database access Wow! I don’t need to worry about DB code! ORM code with performance anti-patterns 8 Bad system performance The performance difference can be LARGE!
  • 9. Performance anti-pattern detection framework Performance anti-pattern detection and ranking framework Ranked according to performance impact Ranked Performance anti-patterns Source Code detection ranking 9
  • 10. Performance anti-pattern detection framework Performance anti-pattern detection and ranking framework Ranked according to performance impact Ranked Performance anti-patterns Source Code detection ranking 10 Discuss only one anti-pattern in the presentation (more patterns in the paper)
  • 11. ORM excessive data anti-pattern Class User{ @EAGER List<Team> teams; } User u = findUserById(1); u.getName(); EOF 11 Objects SQL Eagerly retrieve teams from DB User Table Team Table join Team data is never used!
  • 12. Detecting excessive data using static analysis 12 First find all the objects that eagerly retrieve data from DB Class User{ @EAGER List<Team> teams; } Identify all the data usages of objects User user = findUserByID(1); Check if the retrieved data is ever used user.getName(); user team user team
  • 13. Performance anti-pattern detection framework Performance anti-pattern detection and ranking framework Ranked according to performance impact Ranked Performance anti-patterns Source Code detection ranking 13
  • 14. Performance anti-pattern detection framework Performance anti-pattern detection and ranking framework Ranked according to performance impact Ranked Performance anti-patterns Source Code detection ranking 14
  • 15. Performance anti-patterns have different impacts 15 User user_in_1_team = findUserByID(1); Retrieving 1 user and 1 team User user_in_100_teams = findUserByID(100); Retrieving 1 user and 100 teams! One can only reveal performance impact by execution
  • 16. Measuring the impact using repeated measurements and effect sizes 16 We use effect sizes (Cohen’s D) to measure the performance impact Effect sizes = We repeat each test 30 times to obtain stable measurement results Size of performance impact is not defined: Performance measurements are unstable:
  • 17. Studied systems and detection results Large open-source e-commence system > 1,700 files > 206K LOC Enterprise system > 3,000 files > 300K LOC Spring open-source system Online system for a pet clinic 51 files 3.3K LOC 482 excessive data > 10 excessive data 10 excessive data 17
  • 18. Performance impact Research questions Ranks of the anti-patterns at different scales 18
  • 19. Performance impact Research questions Ranks of the anti-patterns at different scales 19
  • 20. Assessing anti-pattern impact by fixing the anti-patterns Execution Response timeuser.getName() Code with anti-patterns fetchType.set(LAZY) user.getName() Code without anti-patterns 20 Execute test suite 30 times Response time after fixing the anti-patterns Avg. % improvement and effect sizes Execution Execute test suite 30 times
  • 21. Performance anti-patterns have medium to large effect sizes 0% 20% 40% 60% 80% 100% Excessive Data BL EA PC 21 %improvementinresponsetime large effect size large effect size medium effect size
  • 22. Performance impact Research questions Ranks of the anti-patterns at different scales 22 Removing anti-pattern improves response by ~35%
  • 23. Performance impact Research questions Ranks of the anti-patterns at different scales 23 Removing anti-pattern improves response by ~35%
  • 24. Performance problems usually arise under large load 24
  • 25. Performance problems revealed at small scales may be more serious 25 We should first fix the anti-patterns that have larger effects at smaller scales Input scales may have exponential effects on performance Different input scales Performance at different input scales
  • 26. Comparing ranked anti-patterns at different data scales 26 Ranked Performance anti-patterns from small data detection ranking Ranked Performance anti-patterns from large data ? Small size input Large size input
  • 27. Anti-patterns have large effects on performance even at smaller data scales 27 0 10 20 30 40 50 0 1 2 3 4 5 Effectsize Effect sizes and the ranks of the anti-patterns are consistent in different data scales
  • 28. Performance impact Research questions Ranks of the anti-patterns at different scales 28 Removing anti-pattern improves response by ~35% Ranks of the anti-patterns are consistent in different data scales
  • 29. 29
  • 30. 30
  • 31. 31
  • 32. 32