SlideShare a Scribd company logo
Empirical Analysis of Algorithms
●
In practice, we will often need to resort to empirical
rather than theoretical analysis to compare algorithms.
– We may want to know something about performance of the
algorithm “on average” for real instances.
– Our model of computation may not capture important effects
of the hardware architecture that arise in practice.
– There may be implementational details that affect constant
factors and are not captured by asymptotic analysis.
●
For this purpose, we need a methodology for comparing
algorithms based on real-world performance.
Issues to Consider
●
Empirical analysis introduces many more factors that
need to be controlled for in some way.
– Test platform (hardware, language, compiler)
– Measures of performance (what to compare)
– Benchmark test set (what instances to test on)
– Algorithmic parameters
– Implementational details
●
It is much less obvious how to perform a rigorous
analysis in the presence of so many factors.
●
Practical considerations prevent complete testing.
Measures of Performance
●
For the time being, we focus on sequential algorithms.
●
What is an appropriate measure of performance?
●
What is the goal?
– Compare two algorithms.
– Improve the implementation of a single algorithm.
●
Possible measures
– Empirical running time (CPU time, wallclock)
– Representative operation counts
Measuring Time
●
There are three relevant measures of time taken by a
process.
– User time measures the amount of time (number of cycles
taken by a process in “user mode.”
– System time the time taken by the kernel executing on behalf of
the process.
– Wallclock time is the total “real” time taken to execute the
process.
●
Generally speaking, user time is the most relevant,
though it ignores some important operations (I/O, etc.).
●
Wallclock time should be used cautiously/sparingly, but
may be necessary for assessment of parallel codes,
Representative Operation Counts
●
In some cases, we may want to count operations, rather
than time
– Identify bottlenecks
– Counterpart to theoretical analysis
●
What operations should we count?
– Profilers can count function calls and executions of individual
lines of code to identify bottlenecks.
– We may know a priori what operations we want to measure
(example: comparisons and swaps in sorting).
Test Sets
●
It is crucial to choose your test set well.
●
The instances must be chosen carefully in order to allow
proper conclusions to be drawn.
●
We must pay close attention to their size, inherent
difficulty, and other important structural properties.
●
This is especially important if we are trying to
distinguish among multiple algorithms.
●
Example: Sorting
Comparing Algorithms
●
Given a performance measure and a test set, the question
still arises how to decide which algorithm is “better.”
●
We can do the comparison using some sort of summary
statistic.
– Arithmetic mean
– Geometric mean
– Variance
●
These statistics hide information useful for comparison.
Accounting for Stochasticity
●
In empirical analysis, we must take account of the fact
that running times are inherently stochastic.
●
If we are measuring wallclock time, this may vary
substantially for seemingly identical executions.
●
In the case of parallel processing, stochasticity may also
arise due to asynchronism (order of operations).
●
In such case, multiple identical runs may be used to
estimate the affect of this randomness.
●
If necessary, statistical analysis may be used to analyze
the results, but this is beyond the scope of this course.
Performance Profiles
●
Performance profiles allow comparison of algorithms
across an entire test set without loss of information.
●
They provide a visual summary of how algorithms
compare on a performance measure across a test set.
Example Performance Profile
Empirical versus Theoretical Analysis
●
For sequential algorithms, asymptotic analysis is often
good enough for choosing between algorithms.
●
It is less ideal with respect to tuning of implementational
details.
●
For parallel algorithms, asymptotic analysis is far more
problematic.
●
The details not captured by the model of computation
can matter much more.
●
There is an additional dimension on which we must
compare algorithms: scalability.

More Related Content

What's hot

Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
Muhammad Amjad Rana
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
Rishabh Soni
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
Slide2
Slide2Slide2
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Mohamed Loey
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Concept learning
Concept learningConcept learning
Concept learning
Musa Hawamdah
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computing
jayavignesh86
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
FellowBuddy.com
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
Lalit Birla
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
Abhimanyu Mishra
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Kmp
KmpKmp
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
Prabhakaran V M
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
Radhakrishnan Chinnusamy
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronization
Shakshi Ranawat
 
Analysis of algorithn class 2
Analysis of algorithn class 2Analysis of algorithn class 2
Analysis of algorithn class 2
Kumar
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
Knoldus Inc.
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
Hanif Ullah (Gold Medalist)
 

What's hot (20)

Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
Slide2
Slide2Slide2
Slide2
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Concept learning
Concept learningConcept learning
Concept learning
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computing
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Kmp
KmpKmp
Kmp
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronization
 
Analysis of algorithn class 2
Analysis of algorithn class 2Analysis of algorithn class 2
Analysis of algorithn class 2
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
 

Similar to Empirical analysis

Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
NayanChandak1
 
Slides [DAA] Unit 2 Ch 2.pdf
Slides [DAA] Unit 2 Ch 2.pdfSlides [DAA] Unit 2 Ch 2.pdf
Slides [DAA] Unit 2 Ch 2.pdf
Vijayraj799513
 
Algorithms Analysis.pdf
Algorithms Analysis.pdfAlgorithms Analysis.pdf
Algorithms Analysis.pdf
ShaistaRiaz4
 
Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis
Dr. Pankaj Agarwal
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
Mark Price
 
Lec1.ppt
Lec1.pptLec1.ppt
Lec1.ppt
ssuser8bddb2
 
mel705-15.ppt
mel705-15.pptmel705-15.ppt
mel705-15.ppt
DrVivekChauhan1
 
mel705-15.ppt
mel705-15.pptmel705-15.ppt
mel705-15.ppt
Gurumurthy B R
 
Software testing performance testing
Software testing  performance testingSoftware testing  performance testing
Software testing performance testing
GaneshKumarKanthiah
 
Chapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.pptChapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.ppt
Tekle12
 
Chapter1.1 Introduction.ppt
Chapter1.1 Introduction.pptChapter1.1 Introduction.ppt
Chapter1.1 Introduction.ppt
Tekle12
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
GR8Conf
 
Algorithms. Basic course
Algorithms. Basic courseAlgorithms. Basic course
Algorithms. Basic course
ISS Art, LLC
 
WebSphere Business Process Simulationon
WebSphere Business Process SimulationonWebSphere Business Process Simulationon
WebSphere Business Process Simulationon
randikaucsc
 
2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx
RahikAhmed1
 
TEST EXECUTION.ppt
TEST EXECUTION.pptTEST EXECUTION.ppt
TEST EXECUTION.ppt
ChayapathiAR
 
Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...
Sunny Mervyne Baa
 
Process systems engineering lessons learned from the pulp and paper industr...
Process systems engineering   lessons learned from the pulp and paper industr...Process systems engineering   lessons learned from the pulp and paper industr...
Process systems engineering lessons learned from the pulp and paper industr...
pablo-rolandi
 
Simulation.pps.pdf
Simulation.pps.pdfSimulation.pps.pdf
Simulation.pps.pdf
AmanSaini399586
 
Go Observability (in practice)
Go Observability (in practice)Go Observability (in practice)
Go Observability (in practice)
Eran Levy
 

Similar to Empirical analysis (20)

Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
Slides [DAA] Unit 2 Ch 2.pdf
Slides [DAA] Unit 2 Ch 2.pdfSlides [DAA] Unit 2 Ch 2.pdf
Slides [DAA] Unit 2 Ch 2.pdf
 
Algorithms Analysis.pdf
Algorithms Analysis.pdfAlgorithms Analysis.pdf
Algorithms Analysis.pdf
 
Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
Lec1.ppt
Lec1.pptLec1.ppt
Lec1.ppt
 
mel705-15.ppt
mel705-15.pptmel705-15.ppt
mel705-15.ppt
 
mel705-15.ppt
mel705-15.pptmel705-15.ppt
mel705-15.ppt
 
Software testing performance testing
Software testing  performance testingSoftware testing  performance testing
Software testing performance testing
 
Chapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.pptChapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.ppt
 
Chapter1.1 Introduction.ppt
Chapter1.1 Introduction.pptChapter1.1 Introduction.ppt
Chapter1.1 Introduction.ppt
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Algorithms. Basic course
Algorithms. Basic courseAlgorithms. Basic course
Algorithms. Basic course
 
WebSphere Business Process Simulationon
WebSphere Business Process SimulationonWebSphere Business Process Simulationon
WebSphere Business Process Simulationon
 
2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx
 
TEST EXECUTION.ppt
TEST EXECUTION.pptTEST EXECUTION.ppt
TEST EXECUTION.ppt
 
Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...Models of Operational research, Advantages & disadvantages of Operational res...
Models of Operational research, Advantages & disadvantages of Operational res...
 
Process systems engineering lessons learned from the pulp and paper industr...
Process systems engineering   lessons learned from the pulp and paper industr...Process systems engineering   lessons learned from the pulp and paper industr...
Process systems engineering lessons learned from the pulp and paper industr...
 
Simulation.pps.pdf
Simulation.pps.pdfSimulation.pps.pdf
Simulation.pps.pdf
 
Go Observability (in practice)
Go Observability (in practice)Go Observability (in practice)
Go Observability (in practice)
 

Recently uploaded

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 

Recently uploaded (20)

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 

Empirical analysis

  • 1. Empirical Analysis of Algorithms ● In practice, we will often need to resort to empirical rather than theoretical analysis to compare algorithms. – We may want to know something about performance of the algorithm “on average” for real instances. – Our model of computation may not capture important effects of the hardware architecture that arise in practice. – There may be implementational details that affect constant factors and are not captured by asymptotic analysis. ● For this purpose, we need a methodology for comparing algorithms based on real-world performance.
  • 2. Issues to Consider ● Empirical analysis introduces many more factors that need to be controlled for in some way. – Test platform (hardware, language, compiler) – Measures of performance (what to compare) – Benchmark test set (what instances to test on) – Algorithmic parameters – Implementational details ● It is much less obvious how to perform a rigorous analysis in the presence of so many factors. ● Practical considerations prevent complete testing.
  • 3. Measures of Performance ● For the time being, we focus on sequential algorithms. ● What is an appropriate measure of performance? ● What is the goal? – Compare two algorithms. – Improve the implementation of a single algorithm. ● Possible measures – Empirical running time (CPU time, wallclock) – Representative operation counts
  • 4. Measuring Time ● There are three relevant measures of time taken by a process. – User time measures the amount of time (number of cycles taken by a process in “user mode.” – System time the time taken by the kernel executing on behalf of the process. – Wallclock time is the total “real” time taken to execute the process. ● Generally speaking, user time is the most relevant, though it ignores some important operations (I/O, etc.). ● Wallclock time should be used cautiously/sparingly, but may be necessary for assessment of parallel codes,
  • 5. Representative Operation Counts ● In some cases, we may want to count operations, rather than time – Identify bottlenecks – Counterpart to theoretical analysis ● What operations should we count? – Profilers can count function calls and executions of individual lines of code to identify bottlenecks. – We may know a priori what operations we want to measure (example: comparisons and swaps in sorting).
  • 6. Test Sets ● It is crucial to choose your test set well. ● The instances must be chosen carefully in order to allow proper conclusions to be drawn. ● We must pay close attention to their size, inherent difficulty, and other important structural properties. ● This is especially important if we are trying to distinguish among multiple algorithms. ● Example: Sorting
  • 7. Comparing Algorithms ● Given a performance measure and a test set, the question still arises how to decide which algorithm is “better.” ● We can do the comparison using some sort of summary statistic. – Arithmetic mean – Geometric mean – Variance ● These statistics hide information useful for comparison.
  • 8. Accounting for Stochasticity ● In empirical analysis, we must take account of the fact that running times are inherently stochastic. ● If we are measuring wallclock time, this may vary substantially for seemingly identical executions. ● In the case of parallel processing, stochasticity may also arise due to asynchronism (order of operations). ● In such case, multiple identical runs may be used to estimate the affect of this randomness. ● If necessary, statistical analysis may be used to analyze the results, but this is beyond the scope of this course.
  • 9. Performance Profiles ● Performance profiles allow comparison of algorithms across an entire test set without loss of information. ● They provide a visual summary of how algorithms compare on a performance measure across a test set.
  • 11. Empirical versus Theoretical Analysis ● For sequential algorithms, asymptotic analysis is often good enough for choosing between algorithms. ● It is less ideal with respect to tuning of implementational details. ● For parallel algorithms, asymptotic analysis is far more problematic. ● The details not captured by the model of computation can matter much more. ● There is an additional dimension on which we must compare algorithms: scalability.