SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
Hotspot & AOT
Now it’s time to compile
Dmitry Chuyko
Java SE Performance Team
September 22, 2016
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
Contents
1. Introduction
2. The Current Situation
3. Ahead-of-time Compilation
4. Graal
5. JVM Compiler Interface
6. Artifacts
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 2/44
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended
for information purposes only, and may not be incorporated into any contract. It
is not a commitment to deliver any material, code, or functionality, and should
not be relied upon in making purchasing decisions. The development, release, and
timing of any features or functionality described for Oracle’s products remains at
the sole discretion of Oracle.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 3/44
Introduction
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 4/44
Reminder: It’s 2016
‚
JDK 9 Early Access
https://jdk9.java.net/
‚
JDK 8u
‚
JDK 7 End of Public Updates in April 2015
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 5/44
Overview: Computing
A long time ago in a galaxy far, far away...
‚
Pre-computer machines appeared
‚
Computers and their machine codes
‚
Languages and compilers
‚
Scripts
‚
Computer science
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 6/44
Overview: Java
‚
Is a language
‚
Set of specifications
‚
Used to be called slow
’́Because it’s interpreted”
(not true)
‚
”Write once, run anywhere”
(true)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 7/44
Overview: JVM
‚
Is a code itself
‚
Can dynamically execute arbitrary correct bytecode
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 8/44
Overview: JVM
‚
Is a code itself
‚
Can dynamically execute arbitrary correct bytecode
‚
May be written in anything
‚
May produce native code and re-use the result
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 8/44
The Current Situation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 9/44
Overview: Hospot
‚
Is a JVM
‚
Written in C++
‚
Native shared libraries (libjvm)
‚
Produces bytecode dynamically for its own purposes
‚
Does just-in-time compilation
‚
Supports many modes
– Garbage collectors
– Pointers encoding
– etc.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 10/44
Overview: JIT in Hotspot
‚
Tiered compilation
– Level 0. Interpreter
– Level 1. C1 without profiling (optimized), terminal
– Level 2. C1 with basic profiling
– Level 3. C1 with full profiling
– Level 4. C2, terminal, expensive
‚
Unused method versions are thrown away to save footprint
‚
Optimizations, resource constraints
– ñ de-optimizations to level 0
‚
All modes (if not switched off), CPU instruction set
– Custom code
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 11/44
Problem: Application Warm-up
Iterative workload
‚
Startup time
‚
Time to
performance
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 12/44
Problem: Startup Time
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 13/44
Problem: Time to Performance
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 14/44
Problem: Time to Performance
Peak Performance
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 15/44
Problem: Time to Performance
Sum of Iterations
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 16/44
Problem: Application Latency
Iterative workload
‚
Interpreter is
slow
‚
Level 1 (C1) is
relatively also
slow
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 17/44
Problem: Application Latency
‚
Wish it to be HFT. . .
@Transactional void buyOrSell(Quote quote)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 18/44
Problem: Application Latency
‚
Wish it to be HFT. . .
@Transactional void buyOrSell(Quote quote)
– De-optimization when flow changes
– Training workloads
‚
And you meet
void buy_or_sell [[db:transactional]] (Quote* quote)
CFLAGS_ALL += -O3
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 18/44
Problem: Bootstrapping
Meta-circular implementations
‚
It’s possible to write JVM in Java, Scala or JavaScript
‚
”My dear JVM existing as bytecode image, please start and
make yourself efficient in execution of bytecode. Quickly”
‚
Actually the 3 problems above but doubled
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 19/44
Problem: Bootstrapping
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 20/44
Ahead-of-time Compilation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 21/44
Solution: Startup time
‚
Pre-compile initialization code
– No interpreter for class loading, reflection etc.
– No resources for compilation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 22/44
Solution: Time to performance
‚
Pre-compile critical code
– Start with much better than interpreter performance
– No resources for compilation
‚
Reach peak performance
– Collect same profiling info
– JIT with profile-guided optimizations
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 23/44
Solution: Latency
‚
Pre-compile critical code
– High and stable performance
‚ Optimizations
– No de-optimization (almost)
– No re-compilation (almost)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 24/44
Solution: Density, Power Consumption
For free
‚
Some critical code is pre-compiled
‚
Share it
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 25/44
Pre-compilation: Different Solutions Exist
‚
AOT whole application to native executable
– Native exe/elf
– Trial runs for better image layout
– Bundled or shared VM
– Deep dependency analysis
– Pre-defined mode
– JIT is secondary
‚
VM with JIT and AOT compilers
– Optional cache for class data and code
– Trial runs for methods filtering
‚
Replay recorded compilations and optimizations
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 26/44
Pre-compilation: For Hotspot
‚
Need to generate code
– Mostly no de-optimizations
– Better than C1
‚
No tight time budget
‚
Need to resolve and load generated code
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 27/44
Pre-compilation: For Hotspot
‚
Need to generate code
– Mostly no de-optimizations
– Better than C1
‚
No tight time budget
‚
Need to resolve and load generated code
‚
How about one more compiler?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 27/44
Graal
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 28/44
Graal: Project
‚
Experimental dynamic compiler written in Java
‚
Supports Java
‚
OpenJDK project
http://openjdk.java.net/projects/graal/
‚
Oracle Labs team
‚
GraalVM based on Hotspot
http://www.oracle.com/technetwork/oracle-labs/program-
languages/overview/index.html
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 29/44
Graal: For AOT
‚
It proven to work
– SubstrateVM
‚
Flexible and handy
– Modular
– Annotation based way
‚
Possible to avoid most de-optimizations
– No speculative optimizations
– Compile all paths
‚
Focused on performance
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 30/44
Graal: For AOT
‚
It proven to work
– SubstrateVM
‚
Flexible and handy
– Modular
– Annotation based way
‚
Possible to avoid most de-optimizations
– No speculative optimizations
– Compile all paths
‚
Focused on performance
‚
How does it interact with Hotspot?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 30/44
JVM Compiler Interface
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 31/44
JEP 243: Java-Level JVM Compiler Interface
‚
OpenJDK feature, already in 9
http://openjdk.java.net/jeps/243
‚
Experimental feature
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 32/44
JEP 243: Goals
‚
Allow the JVM to load Java plug-in code to examine and
intercept JVM JIT activity.
‚
Record events related to compilation, including counter
overflow, compilation requests, speculation failure, and
deoptimization.
‚
Allow queries to relevant metadata, including loaded classes,
method definitions, profile data, dependencies (speculative
assertions), and compiled code cache.
‚
Allow an external module to capture compilation requests and
produce code to be used for compiled methods.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 33/44
JVMCI: Graal as C2 Replacement
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
[-Djvmci.Compiler=graal]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 34/44
JVMCI: Details
‚
Not used for C1, C2
‚
Special module jdk.vm.ci
‚
Familiar extension patterns
– CompilerFactory, StartupEventListener,
HotSpotJVMCIBackendFactory, HotSpotVMEventListener. . .
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 35/44
JVMCI: How it works
Hotspot
‚
Compilation Queue
‚
Metaspace
‚
Code Cache
JVMCI Compiler
‚
Compilation Request
‚
jdk.vm.ci.meta
‚
byte[]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 36/44
JVMCI: How about this?
Hotspot
‚
Queue
‚
Metaspace
‚
Code Cache
Proxy Network Proxy
Compilation Server
‚
Request
‚
jdk.vm.ci.meta
‚
byte[]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 37/44
Artifacts
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 38/44
Code: AOT Modes
‚
Targeted at problem
– Tiered. Similar to Level 2
– Non-Tiered – Latency
‚
Targeted at VM mode
‚
Defined by Graal/AOT options (profiling, thresholds etc.)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 39/44
Code: AOT & Tired
‚
Tiered
– AOT Ñ level 3 Ñ AOT Ñ level 4
‚
Non-Tiered
– AOT
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 40/44
Code: Libraries
‚
Native shared library (ELF DSO)
– OS knows how to treat it right
– Compatible with tools
– Specific to mode
– Same runtime
‚
Modified Hotspot that works with compiled methods from
shared libraries
‚
New jaotc tool for compilation
– Modules
– Jars
– Classes
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 41/44
Code: libjava.base.so, 240 MB
55%
12%
33%
‚ Code
‚ RW
‚ Other
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 42/44
Packaging: Self-contained Apps
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 43/44
Packaging: Self-contained Apps
‚
Java Packager
– Prepares fancy .dmg for shiny Mac
– Bundled with 100 Mb JRE
‚
JEP 275: Modular Java Application Packaging
http://openjdk.java.net/jeps/275
– jlink helps to generate a JRE image with the required modules only
– Extensions
– AOT libs can be created and added
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 44/44

Mais conteúdo relacionado

Mais procurados

Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]David Buck
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9Simon Ritter
 
What's Expected in Java 7
What's Expected in Java 7What's Expected in Java 7
What's Expected in Java 7Gal Marder
 
Functional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritterFunctional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritterSimon Ritter
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12Simon Ritter
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...David Buck
 
What's New in Java 8
What's New in Java 8What's New in Java 8
What's New in Java 8javafxpert
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]David Buck
 
Java 10 New Features
Java 10 New FeaturesJava 10 New Features
Java 10 New FeaturesAli BAKAN
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the BoxMarcus Hirt
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]David Buck
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9Simon Ritter
 
JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?Simon Ritter
 
Head toward Java 14 and Java 15 #LINE_DM
Head toward Java 14 and Java 15 #LINE_DMHead toward Java 14 and Java 15 #LINE_DM
Head toward Java 14 and Java 15 #LINE_DMYuji Kubota
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]David Buck
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveSimon Ritter
 
Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaC4Media
 
Head toward Java 14 and Java 15
Head toward Java 14 and Java 15Head toward Java 14 and Java 15
Head toward Java 14 and Java 15Yuji Kubota
 

Mais procurados (20)

Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
 
What's Expected in Java 7
What's Expected in Java 7What's Expected in Java 7
What's Expected in Java 7
 
Functional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritterFunctional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritter
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
 
What's New in Java 8
What's New in Java 8What's New in Java 8
What's New in Java 8
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
 
Java 10 New Features
Java 10 New FeaturesJava 10 New Features
Java 10 New Features
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the Box
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?
 
Head toward Java 14 and Java 15 #LINE_DM
Head toward Java 14 and Java 15 #LINE_DMHead toward Java 14 and Java 15 #LINE_DM
Head toward Java 14 and Java 15 #LINE_DM
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep Dive
 
Project Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To JavaProject Jigsaw in JDK 9: Modularity Comes To Java
Project Jigsaw in JDK 9: Modularity Comes To Java
 
Head toward Java 14 and Java 15
Head toward Java 14 and Java 15Head toward Java 14 and Java 15
Head toward Java 14 and Java 15
 

Destaque

Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embettermentAgile Lietuva
 
The most important design lesson from San Francisco
The most important design lesson from San FranciscoThe most important design lesson from San Francisco
The most important design lesson from San FranciscoTautvydas Gylys
 
Wi-Fi Hotspot With Facebook - Barcamp Macau 2014
Wi-Fi Hotspot With Facebook - Barcamp Macau 2014Wi-Fi Hotspot With Facebook - Barcamp Macau 2014
Wi-Fi Hotspot With Facebook - Barcamp Macau 2014kentsi
 
Deep into your applications, performance & profiling
Deep into your applications, performance & profilingDeep into your applications, performance & profiling
Deep into your applications, performance & profilingFabien Arcellier
 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuningIgor Dmitriev
 
Ahead-Of-Time Compilation of Java Applications
Ahead-Of-Time Compilation of Java ApplicationsAhead-Of-Time Compilation of Java Applications
Ahead-Of-Time Compilation of Java ApplicationsNikita Lipsky
 
Object oriented concepts with java
Object oriented concepts with javaObject oriented concepts with java
Object oriented concepts with javaishmecse13
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationMonica Beckwith
 
Java on z overview 20161107
Java on z overview 20161107Java on z overview 20161107
Java on z overview 20161107Marcel Mitran
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applicationspkoza
 
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoValeriia Maliarenko
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.J On The Beach
 
Java collections the force awakens
Java collections  the force awakensJava collections  the force awakens
Java collections the force awakensRichardWarburton
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & ProfilingIsuru Perera
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 

Destaque (20)

Vinted life embetterment
Vinted life embettermentVinted life embetterment
Vinted life embetterment
 
The most important design lesson from San Francisco
The most important design lesson from San FranciscoThe most important design lesson from San Francisco
The most important design lesson from San Francisco
 
Wi-Fi Hotspot With Facebook - Barcamp Macau 2014
Wi-Fi Hotspot With Facebook - Barcamp Macau 2014Wi-Fi Hotspot With Facebook - Barcamp Macau 2014
Wi-Fi Hotspot With Facebook - Barcamp Macau 2014
 
Deep into your applications, performance & profiling
Deep into your applications, performance & profilingDeep into your applications, performance & profiling
Deep into your applications, performance & profiling
 
Setting the right goals
Setting the right goalsSetting the right goals
Setting the right goals
 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuning
 
Ahead-Of-Time Compilation of Java Applications
Ahead-Of-Time Compilation of Java ApplicationsAhead-Of-Time Compilation of Java Applications
Ahead-Of-Time Compilation of Java Applications
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
HotSpotコトハジメ
HotSpotコトハジメHotSpotコトハジメ
HotSpotコトハジメ
 
Building Better Software Faster
Building Better Software FasterBuilding Better Software Faster
Building Better Software Faster
 
Object oriented concepts with java
Object oriented concepts with javaObject oriented concepts with java
Object oriented concepts with java
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
 
Java on z overview 20161107
Java on z overview 20161107Java on z overview 20161107
Java on z overview 20161107
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applications
 
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey Kovalenko
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
 
JVM++: The Graal VM
JVM++: The Graal VMJVM++: The Graal VM
JVM++: The Graal VM
 
Java collections the force awakens
Java collections  the force awakensJava collections  the force awakens
Java collections the force awakens
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 

Semelhante a Hotspot & AOT

Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9Deepu Xavier
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Shaun Smith
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]David Buck
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018CodeOps Technologies LLP
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]David Buck
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best PracticesDavid Delabassee
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8jclingan
 
Graal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian WimmerGraal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian WimmerThomas Wuerthinger
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big DataScott Seighman
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureJavaDayUA
 
Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Curity
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)Logico
 
Java mission control and java flight recorder
Java mission control and java flight recorderJava mission control and java flight recorder
Java mission control and java flight recorderWolfgang Weigend
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsDavid Delabassee
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationFredrik Öhrström
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKWolfgang Weigend
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsDavid Delabassee
 

Semelhante a Hotspot & AOT (20)

Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
Java 8
Java 8Java 8
Java 8
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8
 
Graal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian WimmerGraal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian Wimmer
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and Architecture
 
Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)
 
Java mission control and java flight recorder
Java mission control and java flight recorderJava mission control and java flight recorder
Java mission control and java flight recorder
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integration
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 

Último

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 

Último (20)

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Hotspot & AOT

  • 1. Hotspot & AOT Now it’s time to compile Dmitry Chuyko Java SE Performance Team September 22, 2016 Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
  • 2. Contents 1. Introduction 2. The Current Situation 3. Ahead-of-time Compilation 4. Graal 5. JVM Compiler Interface 6. Artifacts Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 2/44
  • 3. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 3/44
  • 4. Introduction Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 4/44
  • 5. Reminder: It’s 2016 ‚ JDK 9 Early Access https://jdk9.java.net/ ‚ JDK 8u ‚ JDK 7 End of Public Updates in April 2015 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 5/44
  • 6. Overview: Computing A long time ago in a galaxy far, far away... ‚ Pre-computer machines appeared ‚ Computers and their machine codes ‚ Languages and compilers ‚ Scripts ‚ Computer science Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 6/44
  • 7. Overview: Java ‚ Is a language ‚ Set of specifications ‚ Used to be called slow ’́Because it’s interpreted” (not true) ‚ ”Write once, run anywhere” (true) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 7/44
  • 8. Overview: JVM ‚ Is a code itself ‚ Can dynamically execute arbitrary correct bytecode Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 8/44
  • 9. Overview: JVM ‚ Is a code itself ‚ Can dynamically execute arbitrary correct bytecode ‚ May be written in anything ‚ May produce native code and re-use the result Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 8/44
  • 10. The Current Situation Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 9/44
  • 11. Overview: Hospot ‚ Is a JVM ‚ Written in C++ ‚ Native shared libraries (libjvm) ‚ Produces bytecode dynamically for its own purposes ‚ Does just-in-time compilation ‚ Supports many modes – Garbage collectors – Pointers encoding – etc. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 10/44
  • 12. Overview: JIT in Hotspot ‚ Tiered compilation – Level 0. Interpreter – Level 1. C1 without profiling (optimized), terminal – Level 2. C1 with basic profiling – Level 3. C1 with full profiling – Level 4. C2, terminal, expensive ‚ Unused method versions are thrown away to save footprint ‚ Optimizations, resource constraints – ñ de-optimizations to level 0 ‚ All modes (if not switched off), CPU instruction set – Custom code Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 11/44
  • 13. Problem: Application Warm-up Iterative workload ‚ Startup time ‚ Time to performance Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 12/44
  • 14. Problem: Startup Time Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 13/44
  • 15. Problem: Time to Performance Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 14/44
  • 16. Problem: Time to Performance Peak Performance Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 15/44
  • 17. Problem: Time to Performance Sum of Iterations Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 16/44
  • 18. Problem: Application Latency Iterative workload ‚ Interpreter is slow ‚ Level 1 (C1) is relatively also slow Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 17/44
  • 19. Problem: Application Latency ‚ Wish it to be HFT. . . @Transactional void buyOrSell(Quote quote) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 18/44
  • 20. Problem: Application Latency ‚ Wish it to be HFT. . . @Transactional void buyOrSell(Quote quote) – De-optimization when flow changes – Training workloads ‚ And you meet void buy_or_sell [[db:transactional]] (Quote* quote) CFLAGS_ALL += -O3 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 18/44
  • 21. Problem: Bootstrapping Meta-circular implementations ‚ It’s possible to write JVM in Java, Scala or JavaScript ‚ ”My dear JVM existing as bytecode image, please start and make yourself efficient in execution of bytecode. Quickly” ‚ Actually the 3 problems above but doubled Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 19/44
  • 22. Problem: Bootstrapping Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 20/44
  • 23. Ahead-of-time Compilation Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 21/44
  • 24. Solution: Startup time ‚ Pre-compile initialization code – No interpreter for class loading, reflection etc. – No resources for compilation Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 22/44
  • 25. Solution: Time to performance ‚ Pre-compile critical code – Start with much better than interpreter performance – No resources for compilation ‚ Reach peak performance – Collect same profiling info – JIT with profile-guided optimizations Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 23/44
  • 26. Solution: Latency ‚ Pre-compile critical code – High and stable performance ‚ Optimizations – No de-optimization (almost) – No re-compilation (almost) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 24/44
  • 27. Solution: Density, Power Consumption For free ‚ Some critical code is pre-compiled ‚ Share it Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 25/44
  • 28. Pre-compilation: Different Solutions Exist ‚ AOT whole application to native executable – Native exe/elf – Trial runs for better image layout – Bundled or shared VM – Deep dependency analysis – Pre-defined mode – JIT is secondary ‚ VM with JIT and AOT compilers – Optional cache for class data and code – Trial runs for methods filtering ‚ Replay recorded compilations and optimizations Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 26/44
  • 29. Pre-compilation: For Hotspot ‚ Need to generate code – Mostly no de-optimizations – Better than C1 ‚ No tight time budget ‚ Need to resolve and load generated code Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 27/44
  • 30. Pre-compilation: For Hotspot ‚ Need to generate code – Mostly no de-optimizations – Better than C1 ‚ No tight time budget ‚ Need to resolve and load generated code ‚ How about one more compiler? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 27/44
  • 31. Graal Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 28/44
  • 32. Graal: Project ‚ Experimental dynamic compiler written in Java ‚ Supports Java ‚ OpenJDK project http://openjdk.java.net/projects/graal/ ‚ Oracle Labs team ‚ GraalVM based on Hotspot http://www.oracle.com/technetwork/oracle-labs/program- languages/overview/index.html Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 29/44
  • 33. Graal: For AOT ‚ It proven to work – SubstrateVM ‚ Flexible and handy – Modular – Annotation based way ‚ Possible to avoid most de-optimizations – No speculative optimizations – Compile all paths ‚ Focused on performance Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 30/44
  • 34. Graal: For AOT ‚ It proven to work – SubstrateVM ‚ Flexible and handy – Modular – Annotation based way ‚ Possible to avoid most de-optimizations – No speculative optimizations – Compile all paths ‚ Focused on performance ‚ How does it interact with Hotspot? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 30/44
  • 35. JVM Compiler Interface Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 31/44
  • 36. JEP 243: Java-Level JVM Compiler Interface ‚ OpenJDK feature, already in 9 http://openjdk.java.net/jeps/243 ‚ Experimental feature Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 32/44
  • 37. JEP 243: Goals ‚ Allow the JVM to load Java plug-in code to examine and intercept JVM JIT activity. ‚ Record events related to compilation, including counter overflow, compilation requests, speculation failure, and deoptimization. ‚ Allow queries to relevant metadata, including loaded classes, method definitions, profile data, dependencies (speculative assertions), and compiled code cache. ‚ Allow an external module to capture compilation requests and produce code to be used for compiled methods. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 33/44
  • 38. JVMCI: Graal as C2 Replacement -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler [-Djvmci.Compiler=graal] Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 34/44
  • 39. JVMCI: Details ‚ Not used for C1, C2 ‚ Special module jdk.vm.ci ‚ Familiar extension patterns – CompilerFactory, StartupEventListener, HotSpotJVMCIBackendFactory, HotSpotVMEventListener. . . Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 35/44
  • 40. JVMCI: How it works Hotspot ‚ Compilation Queue ‚ Metaspace ‚ Code Cache JVMCI Compiler ‚ Compilation Request ‚ jdk.vm.ci.meta ‚ byte[] Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 36/44
  • 41. JVMCI: How about this? Hotspot ‚ Queue ‚ Metaspace ‚ Code Cache Proxy Network Proxy Compilation Server ‚ Request ‚ jdk.vm.ci.meta ‚ byte[] Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 37/44
  • 42. Artifacts Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 38/44
  • 43. Code: AOT Modes ‚ Targeted at problem – Tiered. Similar to Level 2 – Non-Tiered – Latency ‚ Targeted at VM mode ‚ Defined by Graal/AOT options (profiling, thresholds etc.) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 39/44
  • 44. Code: AOT & Tired ‚ Tiered – AOT Ñ level 3 Ñ AOT Ñ level 4 ‚ Non-Tiered – AOT Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 40/44
  • 45. Code: Libraries ‚ Native shared library (ELF DSO) – OS knows how to treat it right – Compatible with tools – Specific to mode – Same runtime ‚ Modified Hotspot that works with compiled methods from shared libraries ‚ New jaotc tool for compilation – Modules – Jars – Classes Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 41/44
  • 46. Code: libjava.base.so, 240 MB 55% 12% 33% ‚ Code ‚ RW ‚ Other Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 42/44
  • 47. Packaging: Self-contained Apps Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 43/44
  • 48. Packaging: Self-contained Apps ‚ Java Packager – Prepares fancy .dmg for shiny Mac – Bundled with 100 Mb JRE ‚ JEP 275: Modular Java Application Packaging http://openjdk.java.net/jeps/275 – jlink helps to generate a JRE image with the required modules only – Extensions – AOT libs can be created and added Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 44/44