SlideShare a Scribd company logo
1 of 35
Java Performance
Chapter 8
1
Saurav Basu
6/3/2020
Organization
1. Strategies, Approaches, and Methodologies
2. Operating System Performance Monitoring
3. JVM Overview
4. JVM Performance Monitoring
5. Java Application Profiling
6. Java Application Profiling - Tips & Tricks
7. Tuning the JVM - Step by Step
8. Benchmarking Java Applications
9. Benchmarking Multitiered Applications
10. Web Application Performance
11. Web Services Performance
12. Java Persistence & Enterprise Java Beans Performance
2
BenchMarking Java Applications
3
Sno. Micro Macro
1 Repeatable measurement of specific
section of code
Repeatable measurement of whole
application or part performance from user
point of view
2 Abstracted from VM warmup,
garbage collection & other side
effects
Abstracted from performance overhead
caused by monitoring tools
Micro vs Macro Benchmarks
BenchMarking Java Applications
4
1. Challenges with Benchmarks
2. Design of Experiments
3. Use of Statistical Methods
BenchMarking Java Applications
5
1. Challenges with Benchmarks
2. Design of Experiments
3. Use of Statistical Methods
BenchMarking Java Applications
6
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimizing away Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
7
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimizing away Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
8
Challenges with Benchmarks
WarmupTime
1L
50L
WarmUp Cycles
Test Cycles
BenchMarking Java Applications
9
WarmupTime
-XX+PrintCompilation
Challenges with Benchmarks
BenchMarking Java Applications
10
WarmupTim
e
Challenges with Benchmarks
BenchMarking Java Applications
11
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimizing away Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
12
Challenges with Benchmarks
Garbage Collection
Use Serial Garbage Collector: -XX+UseSerialGC
Explicitly set Min & Max Heap Size to same value
Explicitly set Young GenSize
Invoke System.GC() multiple times prior to Benchmark
BenchMarking Java Applications
13
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimizing away Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
14
Java Time APIS
Challenges with Benchmarks
Wide Measurement Intervals
System.nanotime interval
BenchMarking Java Applications
15
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimization of Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
16
Optimization of Dead Code
Challenges with Benchmarks
Make the Computation NonTrivial
Store/Print Computation result outside
measurement interval
BenchMarking Java Applications
17
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimization of Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
18
Inlining
Challenges with Benchmarks
-XX:+UnlockDiagnosticVMOptions
-XX:PrintInlining -XX:+MaxInlineSize
BenchMarking Java Applications
19
Inlining
Challenges with Benchmarks
BenchMarking Java Applications
20
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimization of Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
21
Deoptimization
-XX+PrintCompilation
Challenges with Benchmarks
BenchMarking Java Applications
22
Deoptimization
-XX+PrintCompilation
Challenges with Benchmarks
BenchMarking Java Applications
23
Deoptimization
Challenges with Benchmarks
BenchMarking Java Applications
24
Challenges with Benchmarks
● WarmUp Time
● Garbage Collection
● Java Time APIs
● Optimization of Dead Code
● Inlining
● Deoptimization
● Tips
BenchMarking Java Applications
25
Challenges with Benchmarks
Tips
Specificity of Experiment
Constant Workload
Multiple Metrics
Multiple Iterations
Question Results
Avoid Dead Code
Inlining Effects
Other Application Effects
Steady State Detection
Cache Sensitivity
Thread Scheduling effects
PrintOptoAssembly
BenchMarking Java Applications
26
1. Challenges with Benchmarks
2. Design of Experiments
3. Use of Statistical Methods
BenchMarking Java Applications
27
Design of Experiments
Clearly State Question
Formulate Hypothesis
Test Hypothesis with
Statistical Methods
BenchMarking Java Applications
28
1. Challenges with Benchmarks
2. Design of Experiments
3. Use of Statistical Methods
BenchMarking Java Applications
29
Statistical Methods
Average
Baseline vs Specimen
BenchMarking Java Applications
30
Statistical Methods
Standard Deviation
Baseline vs Specimen
BenchMarking Java Applications
31
Statistical Methods
Confidence Interval
True Average
1-confidence level
Standard deviation
Sample Count
BenchMarking Java Applications
32
Statistical Methods
Confidence Interval of Difference of Mean
True Difference in Average
1- confidence level
Size of Sample 1 & 2
Pooled Standard Deviation
BenchMarking Java Applications
33
Statistical Methods
Confidence Interval of Difference of Mean
BenchMarking Java Applications
34
Statistical Methods
Hypothesis Tests
BenchMarking Java Applications
35
Statistical Methods
Hypothesis Tests

More Related Content

Similar to JavaPerformanceChapter_8

Jmeter Tester Certification
Jmeter Tester CertificationJmeter Tester Certification
Jmeter Tester CertificationVskills
 
How to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery PipelineHow to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery PipelineDynatrace
 
Continuous, efficient & reliable testing with integrated reporting in CI/CD
Continuous, efficient & reliable testing with integrated reporting in CI/CDContinuous, efficient & reliable testing with integrated reporting in CI/CD
Continuous, efficient & reliable testing with integrated reporting in CI/CDMicrosoft Tech Community
 
Mobile User Experience: Auto Drive through Performance Metrics
Mobile User Experience:Auto Drive through Performance MetricsMobile User Experience:Auto Drive through Performance Metrics
Mobile User Experience: Auto Drive through Performance MetricsAndreas Grabner
 
Java Unit Testing Tool Competition — Fifth Round
Java Unit Testing Tool Competition — Fifth RoundJava Unit Testing Tool Competition — Fifth Round
Java Unit Testing Tool Competition — Fifth RoundAnnibale Panichella
 
Performance testing in the cloud webinar jul 2018
Performance testing in the cloud webinar jul 2018Performance testing in the cloud webinar jul 2018
Performance testing in the cloud webinar jul 2018John Emmitt
 
Browser-Based Load Testing with Grafana K6
Browser-Based Load Testing with Grafana K6Browser-Based Load Testing with Grafana K6
Browser-Based Load Testing with Grafana K6Knoldus Inc.
 
Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 QA Systems
 
WebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsWebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsChris Bailey
 
Bugday bkk-2014 nitisak-auto_perf
Bugday bkk-2014 nitisak-auto_perfBugday bkk-2014 nitisak-auto_perf
Bugday bkk-2014 nitisak-auto_perfNitisak Mooltreesri
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testingSQALab
 
Predicting Machine Failure App
Predicting Machine Failure AppPredicting Machine Failure App
Predicting Machine Failure AppAbhinav Bisht
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance TestingGrid Dynamics
 
Automating sap testing with qtp10 & qc10
Automating sap testing with qtp10 & qc10Automating sap testing with qtp10 & qc10
Automating sap testing with qtp10 & qc10Patrick Sun
 
Windmill Testing certification
Windmill Testing certificationWindmill Testing certification
Windmill Testing certificationVskills
 
Impact2014: Practical Performance Troubleshooting
Impact2014: Practical Performance TroubleshootingImpact2014: Practical Performance Troubleshooting
Impact2014: Practical Performance TroubleshootingChris Bailey
 
Node Summit 2016: Web App Architectures
Node Summit 2016:  Web App ArchitecturesNode Summit 2016:  Web App Architectures
Node Summit 2016: Web App ArchitecturesChris Bailey
 
Application Performance Tuning Techniques
Application Performance Tuning TechniquesApplication Performance Tuning Techniques
Application Performance Tuning TechniquesRam Nagesh
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsOutSystems
 

Similar to JavaPerformanceChapter_8 (20)

Jmeter Tester Certification
Jmeter Tester CertificationJmeter Tester Certification
Jmeter Tester Certification
 
How to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery PipelineHow to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery Pipeline
 
Continuous, efficient & reliable testing with integrated reporting in CI/CD
Continuous, efficient & reliable testing with integrated reporting in CI/CDContinuous, efficient & reliable testing with integrated reporting in CI/CD
Continuous, efficient & reliable testing with integrated reporting in CI/CD
 
SaitMourzaev_Resume
SaitMourzaev_ResumeSaitMourzaev_Resume
SaitMourzaev_Resume
 
Mobile User Experience: Auto Drive through Performance Metrics
Mobile User Experience:Auto Drive through Performance MetricsMobile User Experience:Auto Drive through Performance Metrics
Mobile User Experience: Auto Drive through Performance Metrics
 
Java Unit Testing Tool Competition — Fifth Round
Java Unit Testing Tool Competition — Fifth RoundJava Unit Testing Tool Competition — Fifth Round
Java Unit Testing Tool Competition — Fifth Round
 
Performance testing in the cloud webinar jul 2018
Performance testing in the cloud webinar jul 2018Performance testing in the cloud webinar jul 2018
Performance testing in the cloud webinar jul 2018
 
Browser-Based Load Testing with Grafana K6
Browser-Based Load Testing with Grafana K6Browser-Based Load Testing with Grafana K6
Browser-Based Load Testing with Grafana K6
 
Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262
 
WebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsWebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic Tools
 
Bugday bkk-2014 nitisak-auto_perf
Bugday bkk-2014 nitisak-auto_perfBugday bkk-2014 nitisak-auto_perf
Bugday bkk-2014 nitisak-auto_perf
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testing
 
Predicting Machine Failure App
Predicting Machine Failure AppPredicting Machine Failure App
Predicting Machine Failure App
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
Automating sap testing with qtp10 & qc10
Automating sap testing with qtp10 & qc10Automating sap testing with qtp10 & qc10
Automating sap testing with qtp10 & qc10
 
Windmill Testing certification
Windmill Testing certificationWindmill Testing certification
Windmill Testing certification
 
Impact2014: Practical Performance Troubleshooting
Impact2014: Practical Performance TroubleshootingImpact2014: Practical Performance Troubleshooting
Impact2014: Practical Performance Troubleshooting
 
Node Summit 2016: Web App Architectures
Node Summit 2016:  Web App ArchitecturesNode Summit 2016:  Web App Architectures
Node Summit 2016: Web App Architectures
 
Application Performance Tuning Techniques
Application Performance Tuning TechniquesApplication Performance Tuning Techniques
Application Performance Tuning Techniques
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile Applications
 

More from Saurav Basu

JavaPerformanceChapter_12
JavaPerformanceChapter_12JavaPerformanceChapter_12
JavaPerformanceChapter_12Saurav Basu
 
JavaPerformanceChapter_11
JavaPerformanceChapter_11JavaPerformanceChapter_11
JavaPerformanceChapter_11Saurav Basu
 
JavaPerformanceChapter_10
JavaPerformanceChapter_10JavaPerformanceChapter_10
JavaPerformanceChapter_10Saurav Basu
 
Java PerformanceChapter_7
Java PerformanceChapter_7Java PerformanceChapter_7
Java PerformanceChapter_7Saurav Basu
 
JavaPerformanceChapter_6
JavaPerformanceChapter_6JavaPerformanceChapter_6
JavaPerformanceChapter_6Saurav Basu
 
JavaPerformanceChapter_5
JavaPerformanceChapter_5JavaPerformanceChapter_5
JavaPerformanceChapter_5Saurav Basu
 
JavaPerformanceChapter_3
JavaPerformanceChapter_3JavaPerformanceChapter_3
JavaPerformanceChapter_3Saurav Basu
 
JavaPerformanceChapter_2
JavaPerformanceChapter_2JavaPerformanceChapter_2
JavaPerformanceChapter_2Saurav Basu
 
JavaPerformanceChapter_1
JavaPerformanceChapter_1JavaPerformanceChapter_1
JavaPerformanceChapter_1Saurav Basu
 
Application Deployment Architecture
Application Deployment ArchitectureApplication Deployment Architecture
Application Deployment ArchitectureSaurav Basu
 

More from Saurav Basu (10)

JavaPerformanceChapter_12
JavaPerformanceChapter_12JavaPerformanceChapter_12
JavaPerformanceChapter_12
 
JavaPerformanceChapter_11
JavaPerformanceChapter_11JavaPerformanceChapter_11
JavaPerformanceChapter_11
 
JavaPerformanceChapter_10
JavaPerformanceChapter_10JavaPerformanceChapter_10
JavaPerformanceChapter_10
 
Java PerformanceChapter_7
Java PerformanceChapter_7Java PerformanceChapter_7
Java PerformanceChapter_7
 
JavaPerformanceChapter_6
JavaPerformanceChapter_6JavaPerformanceChapter_6
JavaPerformanceChapter_6
 
JavaPerformanceChapter_5
JavaPerformanceChapter_5JavaPerformanceChapter_5
JavaPerformanceChapter_5
 
JavaPerformanceChapter_3
JavaPerformanceChapter_3JavaPerformanceChapter_3
JavaPerformanceChapter_3
 
JavaPerformanceChapter_2
JavaPerformanceChapter_2JavaPerformanceChapter_2
JavaPerformanceChapter_2
 
JavaPerformanceChapter_1
JavaPerformanceChapter_1JavaPerformanceChapter_1
JavaPerformanceChapter_1
 
Application Deployment Architecture
Application Deployment ArchitectureApplication Deployment Architecture
Application Deployment Architecture
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

JavaPerformanceChapter_8

Editor's Notes

  1. Let us now talk about Benchmarking Java Applications
  2. This slide describes diffrerences between a micro and macro benchmark
  3. This topic has 3 sections namely: Challenges with benchmarks Design of Experiments Use of Statistical methods
  4. Let us first look at the challenges with benchmarks
  5. This slide lists the challenges and issues with benchmarking java applications
  6. Lets start warmup time
  7. This slide shows an example of code that warms up code prior to test By default, the HotSpot Server VM executes a block of Java byte code 10,000 times before the HotSpot Server JIT compiler produces native machine code for that block of Java bytecode. The HotSpot Client VM begins producing native machine code at 1,500 iterati It is important to check for Compilation activity during the measurement interval when executing a benchmark.
  8. Use this VM option to check for compilation activity during measurement interval
  9. This slide shows a small portion of output produced by -XX:+PrintCompilation on a micro-benchmark A way to ensure a HotSpot JIT compiler has reached steady state, finished its optimizations, and generated optimized code for a benchmark is to execute a run of the benchmark with the HotSpot VM command line option -XX:+PrintCompilation along with instrumenting the benchmark to indicate when it has completed the warm-up period. -XX:+PrintCompilation causes the JVM to print a line for each method as it optimizes or deoptimizes.
  10. Next let us look at Garbage Collection
  11. This slide lists steps to minimize the impact of gc on benchmark results. Garbage Collectors consume cpu cycles and can pause the application threads while execution of benchmark. It is important to tune the the garbage collector prior to execution of the benchmark. For microbenchmark following steps can avoid gc impact on measurement.
  12. Lets now talk about java time apis
  13. This slide talks about guidelines to follow when using java time apis for benchmarking programs. Java millisecond and nanosecond api are precise but not accurate since the value depends on underlying operating system, hence for benchmarking purpose it is advisable to use a sufficiently large interval relative a nanosecond
  14. Next we will talk about Optimization of Dead code
  15. JVM optimization of unreachable code and skew benchmark. Good practice are to keep the computation nontrivial and store the results of computation outside the measurement interval
  16. Next we will look at Inlining
  17. For microbenchmarks VMs can mark inlined methods as dead code if the method return value is not used. It is advisable to use the following VM options to check the behavior of JVM in such cases
  18. Slide image displays output of printInline VM option showing methods that are inlined by JVM
  19. Next we will talk about deoptimization
  20. Use this VM option to check for deoptimization of code during execution of a benchmark
  21. Use this VM option to check for deoptimization of code during execution of a benchmark. Deoptimization during benchmark execution can skew benchmark result so it is important to track this while running micro benchmarks
  22. This slide shows that JVM deoptimization during benchmark run can be detected with +PrintCompilation method (This can happen if the aggressive optimization decision is undone due to earlier incorrect assumption about about method argument)
  23. Next we will look at tips to design good experiments
  24. This slide lists the factors to keep in mind when designing experiments to benchmark applications
  25. Next we will talk about design of experiments
  26. This slide talks about the steps to design a good experiment 1. Clearly State the question that the experiment is trying to answer(DOes a 100mb increase in young gen space result in 1% improvement on specific benchmark on specific hardware configuration?) 2. Formulate a hypothesis: (Ex: Is the improvement from the change atleast 10%?) 3. Use statistical techniques to validate the hypothesis. (Confidence Interval Tests)
  27. Next we will look at use of statistical methods for benchmarks
  28. Compute average of metric of both baseline (before change) and specimen after change Baseline Average is the sum of all observations of baseline divided by the number of baseline executions Specimen Average is the sum of all observations of specimen divided by the number of specimen executions
  29. Baseline or specimen’s variability can be evaluated by computing a sample standard deviation (s)
  30. Calculate a Confidence interval for estimation of true average of baseline and specimen observation using tvalue for a given value of alpha and n-1 degree of freedom as shown in figure Here alpha = 1- confidence level chosen
  31. This slide shows the formula to compute a confidence interval for a true difference of sample means
  32. Value of pooled standard deviation (s) in previous slide is calculated using the following formula where s1 and s2 are the standard deviation of sample 1 and sample 2.
  33. In this approach, a hypothesis, more formally known as a null hypothesis, is formulated based on a problem statement, that is, what you want to know. Then data is collected and a t-statistic is calculated based on the collected observations. The t-statistic is compared to a value obtained from a Student’s t-distribution for an a (alpha) and degrees of freedom alpha is the risk level at which you are willing to incorrectly accept the null hypothesis as true when it is really false, also known in statistical terms as a Type I Error This slide shows the formula for calculation of t value for hypothesis tests.
  34. In this approach, a hypothesis, more formally known as a null hypothesis, is formulated based on a problem statement, that is, what you want to know. Then data is collected and a t-statistic is calculated based on the collected observations. The t-statistic is compared to a value obtained from a Student’s t-distribution for an a (alpha) and degrees of freedom alpha is the risk level at which you are willing to incorrectly accept the null hypothesis as true when it is really false, also known in statistical terms as a Type I Error This slide shows the formula for calculation of t value for hypothesis tests.