SlideShare a Scribd company logo
Java JIT Testing
ADAM FELDSCHER
CSI699 PERFORMANCE DESIGN II 10/29/2019
IEEE 2003
Random Program Generator for
Java JIT Compiler Test System
Yoshikawa, T., Shimura, K., & Ozawa, T. (2003). Random Program Generator For Java JIT
Compiler Test System. Third International Conference On Quality Software, 2003.
Proceedings. Doi: 10.1109/Qsic.2003.1319081
How to Test JIT?
• Developed random test program generator
◦ Generates random, but executable class files
◦ Generating human readable byte-code, not Java!
◦ Runs on target JIT compiler
◦ Compares results between compilers
• Number of classes decided randomly
◦ Makes random, acyclic, parenthood relationships
• Produces random methods in each class
◦ Random params
◦ Has them call each other, with priorities to avoid recursion
◦ INVOKESTATIC / INVOKEVIRTUAL
◦ Creates interfaces for some classes
Control Flow
• Adds branches in each method
◦ Including loops
• Field accesses are produced
◦ GETSTATIC/GETFIELD
• Adds other local variables
◦ And fills in with more byte codes
◦ Lots of Stack operations
Implementation and Evaluation
Can’t find the code…
OverOps Bullshifier 2016
• “built internally for heavy duty testing of monitoring tools on random Java
code”
• Generates large projects
◦ Flag for number of classes 500 – 20,000
◦ Deep call stacks
◦ Lots of code and logging
• Generated methods have:
◦ Variable definition, random types, random names
◦ Random exception throwing / Logging
◦ Calls to next method
◦ Unexecutable code
• https://github.com/takipi/java-bullshifier
Running their example
Sample Generations
• Black (color leveled, 2nd worst)
◦ 1000 Classes
◦ 50 Entry Points
◦ Switcher 200 max routes
◦ 1 Method per class
◦ 1 Log per method
• Arguments:
◦ java -cp black/build/libs/black.jar helpers.Main -ec 10000 -im 0 -hs
◦ Throw 10,000 exceptions
◦ 0 gap in-between
◦ Hide stack traces
Old Versions of Java
• JDK 1.1 – February 1997 -- No Linux
• JDK 1.2 Playground – December 1998 -- No 64 bit
• J2SE 5.0 Tiger – September 2004
• JDK 7 Dolphin – July 2011
• JDK 11 – September 2018
Test Machine
• Intel(R) Core(TM)2 Duo CPU E6550
◦ 64 Bit
◦ 2.33GHz
• 2GB Ram
• Ubuntu 18.04.3 LTS
Results
0
500
1000
1500
2000
2500
3000
3500
4000
4500
11 11 11 11 11 7 7 7 7 7 5 5 5 5 5
Runtime(ms)
JRE Version
Time to 10,000 Exceptions Bullshifer
Execution Time Average
Same Test, Prime Code
0
0.005
0.01
0.015
0.02
0.025
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100
ExecutionTime(sec)
Iterations
Prime Finder JRE Comparison
Java 5
Java 7
Java 11
Zoomed Start
0
0.005
0.01
0.015
0.02
0.025
1 2 3 4 5 6 7 8
ExecutionTime
Iterations
Prime Finder JRE Comparison (zoomed)
Java 5
Java 7
Java 11
Total Times
0.164
0.166
0.168
0.17
0.172
0.174
0.176
0.178
0.18
0.182
Java 5 Java 7 Java 11
ExecutionTime
Prime Finder Total Times
Zoomed End
0
0.0005
0.001
0.0015
0.002
0.0025
0.003
0.0035
87 88 89 90 91 92 93 94 95 96 97 98 99
ExecutionTime(sec)
Iterations
Prime Finder JRE Comparison
Java 5
Java 7
Java 11
Average Time, after iteration 10
0.00135
0.0014
0.00145
0.0015
0.00155
0.0016
Java 5 Java 7 Java 11
ExecutionTime
Prime Finder Average Times
Mean
Median
JITWatch Java5
No JIT
JITWatch Java7
JIT Methods!
JITWatch Java7
JITWatch Java7
JITWatch Java7
JITWatch Java 11
• Can’t get it to parse!
Compiled method (c1) 211 70 3 com.aff39.PrimeFinder::is_prime (73 bytes)
Compiled method (c2) 220 73 4 com.aff39.PrimeFinder::is_prime (73 bytes)
Compiled method (c1) 708 270 % 3 com.aff39.PrimeFinder::find_primes @ 10 (74 bytes)
Compiled method (c1) 719 272 3 com.aff39.PrimeFinder::find_primes (74 bytes)
Compiled method (c2) 741 274 % 4 com.aff39.PrimeFinder::find_primes @ 10 (74 bytes)
Compiled method (c2) 761 279 4 com.aff39.PrimeFinder::find_primes (74 bytes)

More Related Content

PDF
kci-linuxcon
PPTX
Burp Suite Extensions
DOC
Appsdba interview question
PDF
Docker
PPTX
Docker - fast dev faster testing
PPTX
Swifty Serverless: How to minimise latencies and cold start period for server...
PDF
猿でもわかるバイナリ・リポジトリマネージャー
PDF
kci-linuxcon
Burp Suite Extensions
Appsdba interview question
Docker
Docker - fast dev faster testing
Swifty Serverless: How to minimise latencies and cold start period for server...
猿でもわかるバイナリ・リポジトリマネージャー

What's hot (14)

PPTX
sbt server (LSP discussion, 2018 Jan)
PPTX
High 5 Final Presentation
PDF
Taming Pythons with ZooKeeper (Pyconfi edition)
PDF
Continuous Kernel Integration
PPTX
History of Android Security – from linux to jelly bean
PPTX
Linker namespace upload
PDF
Trace everything, when APM meets SysAdmins
PPTX
Container Security
PDF
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
PDF
REX about installing Kubernetes on Premise
PPTX
Preempt_rt realtime patch
PDF
Creating AWS infrastructure using Terraform
KEY
MongoDB as Search Engine Repository @ MongoTokyo2011
PPTX
Win32/Duqu: involution of Stuxnet
sbt server (LSP discussion, 2018 Jan)
High 5 Final Presentation
Taming Pythons with ZooKeeper (Pyconfi edition)
Continuous Kernel Integration
History of Android Security – from linux to jelly bean
Linker namespace upload
Trace everything, when APM meets SysAdmins
Container Security
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
REX about installing Kubernetes on Premise
Preempt_rt realtime patch
Creating AWS infrastructure using Terraform
MongoDB as Search Engine Repository @ MongoTokyo2011
Win32/Duqu: involution of Stuxnet
Ad

Similar to Java JIT Performance Testing and Results (20)

PDF
Creation of a Test Bed Environment for Core Java Applications using White Box...
PPTX
GOTO Night with Charles Nutter Slides
PPT
ProspectusPresentationPrinterFriendly
PPTX
Java Jit. Compilation and optimization by Andrey Kovalenko
PDF
How difficult is to get a JIT right? Talk from ESGU 2024
PDF
Scjp6.0
PPTX
Java History - MyExamCloud Presentation
PPTX
The latest features coming to Java 12
PDF
Lifecycle of a JIT compiled code
PDF
JVM Mechanics
PDF
JCConf 2018 - Retrospect and Prospect of Java
PDF
Summary of JDK10 and What will come into JDK11
PPTX
Java JIT Improvements Research
PPTX
LLLecture-JAVAPROGRAMMINGBasics1.KI.pptx
PPTX
Graal in GraalVM - A New JIT Compiler
PDF
The Diabolical Developer's Guide to Surviving Java 9
PDF
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
DOCX
Java 7 Dolphin manjula kollipara
PDF
Java 40 versions_sgp
PPTX
First adoption hackathon at BGJUG
Creation of a Test Bed Environment for Core Java Applications using White Box...
GOTO Night with Charles Nutter Slides
ProspectusPresentationPrinterFriendly
Java Jit. Compilation and optimization by Andrey Kovalenko
How difficult is to get a JIT right? Talk from ESGU 2024
Scjp6.0
Java History - MyExamCloud Presentation
The latest features coming to Java 12
Lifecycle of a JIT compiled code
JVM Mechanics
JCConf 2018 - Retrospect and Prospect of Java
Summary of JDK10 and What will come into JDK11
Java JIT Improvements Research
LLLecture-JAVAPROGRAMMINGBasics1.KI.pptx
Graal in GraalVM - A New JIT Compiler
The Diabolical Developer's Guide to Surviving Java 9
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Java 7 Dolphin manjula kollipara
Java 40 versions_sgp
First adoption hackathon at BGJUG
Ad

More from Adam Feldscher (7)

PPTX
Optimizing Java Notes
PPTX
Java JIT Optimization Research
PPTX
C++ & Java JIT Optimizations: Finding Prime Numbers
PPTX
C vs Java: Finding Prime Numbers
PPTX
Paper summary
PPTX
Optimizing Java
PPTX
Performance Design Patterns 3
Optimizing Java Notes
Java JIT Optimization Research
C++ & Java JIT Optimizations: Finding Prime Numbers
C vs Java: Finding Prime Numbers
Paper summary
Optimizing Java
Performance Design Patterns 3

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Introduction and Scope of Bichemistry.pptx
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
From loneliness to social connection charting
PDF
Module 3: Health Systems Tutorial Slides S2 2025
PDF
Pre independence Education in Inndia.pdf
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PDF
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
PDF
Insiders guide to clinical Medicine.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
Pharma ospi slides which help in ospi learning
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Introduction and Scope of Bichemistry.pptx
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Renaissance Architecture: A Journey from Faith to Humanism
NOI Hackathon - Summer Edition - GreenThumber.pptx
Cell Structure & Organelles in detailed.
O7-L3 Supply Chain Operations - ICLT Program
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
From loneliness to social connection charting
Module 3: Health Systems Tutorial Slides S2 2025
Pre independence Education in Inndia.pdf
Open Quiz Monsoon Mind Game Final Set.pptx
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
Insiders guide to clinical Medicine.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
STATICS OF THE RIGID BODIES Hibbelers.pdf
UPPER GASTRO INTESTINAL DISORDER.docx

Java JIT Performance Testing and Results

  • 1. Java JIT Testing ADAM FELDSCHER CSI699 PERFORMANCE DESIGN II 10/29/2019
  • 2. IEEE 2003 Random Program Generator for Java JIT Compiler Test System Yoshikawa, T., Shimura, K., & Ozawa, T. (2003). Random Program Generator For Java JIT Compiler Test System. Third International Conference On Quality Software, 2003. Proceedings. Doi: 10.1109/Qsic.2003.1319081
  • 3. How to Test JIT? • Developed random test program generator ◦ Generates random, but executable class files ◦ Generating human readable byte-code, not Java! ◦ Runs on target JIT compiler ◦ Compares results between compilers • Number of classes decided randomly ◦ Makes random, acyclic, parenthood relationships • Produces random methods in each class ◦ Random params ◦ Has them call each other, with priorities to avoid recursion ◦ INVOKESTATIC / INVOKEVIRTUAL ◦ Creates interfaces for some classes
  • 4. Control Flow • Adds branches in each method ◦ Including loops • Field accesses are produced ◦ GETSTATIC/GETFIELD • Adds other local variables ◦ And fills in with more byte codes ◦ Lots of Stack operations
  • 7. OverOps Bullshifier 2016 • “built internally for heavy duty testing of monitoring tools on random Java code” • Generates large projects ◦ Flag for number of classes 500 – 20,000 ◦ Deep call stacks ◦ Lots of code and logging • Generated methods have: ◦ Variable definition, random types, random names ◦ Random exception throwing / Logging ◦ Calls to next method ◦ Unexecutable code • https://github.com/takipi/java-bullshifier
  • 9. Sample Generations • Black (color leveled, 2nd worst) ◦ 1000 Classes ◦ 50 Entry Points ◦ Switcher 200 max routes ◦ 1 Method per class ◦ 1 Log per method • Arguments: ◦ java -cp black/build/libs/black.jar helpers.Main -ec 10000 -im 0 -hs ◦ Throw 10,000 exceptions ◦ 0 gap in-between ◦ Hide stack traces
  • 10. Old Versions of Java • JDK 1.1 – February 1997 -- No Linux • JDK 1.2 Playground – December 1998 -- No 64 bit • J2SE 5.0 Tiger – September 2004 • JDK 7 Dolphin – July 2011 • JDK 11 – September 2018
  • 11. Test Machine • Intel(R) Core(TM)2 Duo CPU E6550 ◦ 64 Bit ◦ 2.33GHz • 2GB Ram • Ubuntu 18.04.3 LTS
  • 12. Results 0 500 1000 1500 2000 2500 3000 3500 4000 4500 11 11 11 11 11 7 7 7 7 7 5 5 5 5 5 Runtime(ms) JRE Version Time to 10,000 Exceptions Bullshifer Execution Time Average
  • 13. Same Test, Prime Code 0 0.005 0.01 0.015 0.02 0.025 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 ExecutionTime(sec) Iterations Prime Finder JRE Comparison Java 5 Java 7 Java 11
  • 14. Zoomed Start 0 0.005 0.01 0.015 0.02 0.025 1 2 3 4 5 6 7 8 ExecutionTime Iterations Prime Finder JRE Comparison (zoomed) Java 5 Java 7 Java 11
  • 15. Total Times 0.164 0.166 0.168 0.17 0.172 0.174 0.176 0.178 0.18 0.182 Java 5 Java 7 Java 11 ExecutionTime Prime Finder Total Times
  • 16. Zoomed End 0 0.0005 0.001 0.0015 0.002 0.0025 0.003 0.0035 87 88 89 90 91 92 93 94 95 96 97 98 99 ExecutionTime(sec) Iterations Prime Finder JRE Comparison Java 5 Java 7 Java 11
  • 17. Average Time, after iteration 10 0.00135 0.0014 0.00145 0.0015 0.00155 0.0016 Java 5 Java 7 Java 11 ExecutionTime Prime Finder Average Times Mean Median
  • 23. JITWatch Java 11 • Can’t get it to parse! Compiled method (c1) 211 70 3 com.aff39.PrimeFinder::is_prime (73 bytes) Compiled method (c2) 220 73 4 com.aff39.PrimeFinder::is_prime (73 bytes) Compiled method (c1) 708 270 % 3 com.aff39.PrimeFinder::find_primes @ 10 (74 bytes) Compiled method (c1) 719 272 3 com.aff39.PrimeFinder::find_primes (74 bytes) Compiled method (c2) 741 274 % 4 com.aff39.PrimeFinder::find_primes @ 10 (74 bytes) Compiled method (c2) 761 279 4 com.aff39.PrimeFinder::find_primes (74 bytes)

Editor's Notes

  • #13: Its exception handling code! So maybe java 11 is doing more for exceptions? Or we’re not optimizing in the same ways
  • #15: 7, 5, 11
  • #16: 7, 5, 11 still, JIT being the biggest factor
  • #17: 5, 11, 7 now
  • #18: 5, 11, 7 7 Spent more time Jit-ing, maybe it compiled lower, or used more in depth optimizations