SlideShare una empresa de Scribd logo
1 de 64
Descargar para leer sin conexión
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Winning with Java

At Market Open

Getting Fast & Staying Fast

Gil Tene, CTO & co-Founder, Azul Systems
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Are you fast at Market Open?
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at Market Open
. . .
Market Open
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
Aggressively optimized for
the common case
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
Aggressively optimized for
the common case
(temporarily) Reverts to
slower execution to adapt
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
Aggressively optimized for
the common case
(temporarily) Reverts to
slower execution to adapt
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
Aggressively optimized for
the common case
(temporarily) Reverts to
slower execution to adapt
. . .
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
Aggressively optimized for
the common case
(temporarily) Reverts to
slower execution to adapt
Warmup
. . .
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast
Lazy loading & initialization
Aggressively optimized for
the common case
(temporarily) Reverts to
slower execution to adapt
Warmup
Deoptimization
. . .
Speculative compiler tricks
JIT compilers can do things that
static compilers can have
a hard time with…
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Untaken path example
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Untaken path example
“Never taken” paths can be optimized away with benefits:
void computeMagnitude(int val) {
if (val > 10) {
bias = computeBias(val);
else {
bias = 1;
}
return Math.log10(bias + 99);
}
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Untaken path example
“Never taken” paths can be optimized away with benefits:
void computeMagnitude(int val) {
if (val > 10) {
bias = computeBias(val);
else {
bias = 1;
}
return Math.log10(bias + 99);
}
When all values so far were <= 10 , can be optimized to:
void computeMagnitude(int val) {
if (val > 10) uncommonTrap();
return 2;
}
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Implicit Null Check example
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Implicit Null Check example
All field and array access in Java is null checked
x = foo.x;
is (in equivalent required machine code):
if (foo == null)
throw new NullPointerException();
x = foo.x;
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Implicit Null Check example
All field and array access in Java is null checked
x = foo.x;
is (in equivalent required machine code):
if (foo == null)
throw new NullPointerException();
x = foo.x;
But compiler can “hope” for non-nulls, and handle SEGV
<Point where later SEGV will appear to throw>
x = foo.x;
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Implicit Null Check example
All field and array access in Java is null checked
x = foo.x;
is (in equivalent required machine code):
if (foo == null)
throw new NullPointerException();
x = foo.x;
But compiler can “hope” for non-nulls, and handle SEGV
<Point where later SEGV will appear to throw>
x = foo.x;
This is faster *IF* no nulls are encountered…
Deoptimization
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
Can “hope” about things and can recover if wrong
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
Can “hope” about things and can recover if wrong
Warming up code is a black art
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
Can “hope” about things and can recover if wrong
Warming up code is a black art
Running code long enough to compile is just the start…
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
Can “hope” about things and can recover if wrong
Warming up code is a black art
Running code long enough to compile is just the start…
Deoptimization can occur at any time
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
Can “hope” about things and can recover if wrong
Warming up code is a black art
Running code long enough to compile is just the start…
Deoptimization can occur at any time
often occur after you *think* the code is warmed up.
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Deoptimization:

Adaptive compilation is… adaptive
JIT Compilers are adaptive and speculative
Leverage observations of behavior
Can “hope” about things and can recover if wrong
Warming up code is a black art
Running code long enough to compile is just the start…
Deoptimization can occur at any time
often occur after you *think* the code is warmed up.
Deoptimization has many potential causes
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Warmup often doesn’t cut it…
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Warmup often doesn’t cut it…
Common Example:

Trading system wants to have the first trade be fast

So run 20,000 “fake” messages through the system to warm up

let JIT compilers optimize, learn, and deopt before actual trades
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Warmup often doesn’t cut it…
Common Example:

Trading system wants to have the first trade be fast

So run 20,000 “fake” messages through the system to warm up

let JIT compilers optimize, learn, and deopt before actual trades
What really happens

Code is written to do different things “if this is a fake message”

e.g. “Don’t send to the exchange if this is a fake message”

JITs optimize for fake path, including speculatively assuming “fake”

First real message through deopts...
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
A few example causes for
depotimization
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
A few example causes for
depotimization

Newly encountered code breaking prior assumptions
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
A few example causes for
depotimization

Newly encountered code breaking prior assumptions
First calls to method in an uninitialized class
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
A few example causes for
depotimization

Newly encountered code breaking prior assumptions
First calls to method in an uninitialized class
First call to a method in a not-yet-loaded class
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
A few example causes for
depotimization

Newly encountered code breaking prior assumptions
First calls to method in an uninitialized class
First call to a method in a not-yet-loaded class
Dynamic branch elimination hitting an unexpected path
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
A few example causes for
depotimization

Newly encountered code breaking prior assumptions
First calls to method in an uninitialized class
First call to a method in a not-yet-loaded class
Dynamic branch elimination hitting an unexpected path
Implicit Null Check hitting a null
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java’s “Just In Time” Reality
Starts slow, learns fast

Lazy loading & initialization

Aggressively optimized for
the common case

(temporarily) Reverts to
slower execution to adapt
Warmup
Deoptimization
. . .
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Starts slow, learns fast

Lazy loading & initialization

Aggressively optimized for
the common case

(temporarily) Reverts to
slower execution to adapt
What we have
Java’s “Just In Time” Reality
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Starts slow, learns fast

Lazy loading & initialization

Aggressively optimized for
the common case

(temporarily) Reverts to
slower execution to adapt
What we have What we want
Java’s “Just In Time” Reality
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Starts slow, learns fast

Lazy loading & initialization

Aggressively optimized for
the common case

(temporarily) Reverts to
slower execution to adapt
What we have What we want
No Slow Ops or Trades
Java’s “Just In Time” Reality
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Starts slow, learns fast

Lazy loading & initialization

Aggressively optimized for
the common case

(temporarily) Reverts to
slower execution to adapt
What we have What we want
No Slow Ops or Trades
ReadyNow!
to the rescue
Java’s “Just In Time” Reality
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
What can we do about it?
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
What can we do about it?
Azul’s Zing JVM has a feature set called “ReadyNow!”

Avoids deoptimization while keeping code fast

Allows code to reach optimized levels without requiring “exercise”
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
What can we do about it?
Azul’s Zing JVM has a feature set called “ReadyNow!”

Avoids deoptimization while keeping code fast

Allows code to reach optimized levels without requiring “exercise”
Learning and retaining optimizations

With Zing, your next run can learn from the previous one
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
What can we do about it?
Azul’s Zing JVM has a feature set called “ReadyNow!”

Avoids deoptimization while keeping code fast

Allows code to reach optimized levels without requiring “exercise”
Learning and retaining optimizations

With Zing, your next run can learn from the previous one
Fine grained control options

Per method compiler directives

…
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Logging & “replaying”optimizations
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Logging & “replaying”optimizations
Zing’s ReadyNow includes optimization logging

Records ongoing optimization decisions and stats

records optimization dependencies

Establishes “stable optimization state” at end of previous run
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Logging & “replaying”optimizations
Zing’s ReadyNow includes optimization logging

Records ongoing optimization decisions and stats

records optimization dependencies

Establishes “stable optimization state” at end of previous run
Zing can then read prior logs at startup

Prime JVM with knowledge of prior stable optimizations 

Optimizations are applied as their dependencies get resolved
©2012 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Logging & “replaying”optimizations
Zing’s ReadyNow includes optimization logging

Records ongoing optimization decisions and stats

records optimization dependencies

Establishes “stable optimization state” at end of previous run
Zing can then read prior logs at startup

Prime JVM with knowledge of prior stable optimizations 

Optimizations are applied as their dependencies get resolved
ReadyNow workflow promotes confidence

You’ll know if/when all optimizations have been applied

If some optimization haven’t been applied, you’ll know why…
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at “Load Start”
. . .
Load Start
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at “Load Start”
. . .
Load Start
Deoptimization
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at “Load Start”
. . .
Load Start
Deoptimization
ReadyNow!
avoids
deoptimization
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at “Load Start”
. . .
Load Start
With Zing & ReadyNow!
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at “Load Start”
. . .
Load Start
With ReadyNow!
Warmup?
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Java at “Load Start”
. . .
Load Start
With ReadyNow!
Warmup?
Fast From
The Start
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
. . .
Load Start
With ReadyNow! and
Start Fast & Stay Fast
Java at “Load Start”
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
. . .
Load Start
With Zing & ReadyNow!
Start Fast & Stay Fast
Java at “Load Start”
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
. . .
Load Start
With Zing & ReadyNow!
Start Fast & Stay Fast
Java at “Load Start”
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
. . .
Load Start
With Zing & ReadyNow!
Start Fast & Stay Fast
Java at “Load Start”
With
Confidence
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
One liner takeaway
. . .
Load Start
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
One liner takeaway
. . .
Zing: A cure for the Java hiccups
Load Start

Más contenido relacionado

Destacado

Making Business Happen, Greater Birmingham
Making Business Happen, Greater Birmingham Making Business Happen, Greater Birmingham
Making Business Happen, Greater Birmingham Kate Evans
 
JVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentationJVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentationAzul Systems, Inc.
 
Git 들여다보기(1)
Git 들여다보기(1)Git 들여다보기(1)
Git 들여다보기(1)Kim Byoungsu
 
Axx oms backup procedure remotely
Axx oms backup procedure remotelyAxx oms backup procedure remotely
Axx oms backup procedure remotelyKrishna Kumar
 
5 VARIABLES in MANUFACTURING PRODN
5 VARIABLES in MANUFACTURING PRODN5 VARIABLES in MANUFACTURING PRODN
5 VARIABLES in MANUFACTURING PRODNEd Aliño
 
La informática en el periodismo
La informática en el periodismoLa informática en el periodismo
La informática en el periodismoValentinaM16
 

Destacado (11)

bilogi annelida
bilogi annelidabilogi annelida
bilogi annelida
 
Making Business Happen, Greater Birmingham
Making Business Happen, Greater Birmingham Making Business Happen, Greater Birmingham
Making Business Happen, Greater Birmingham
 
JVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentationJVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentation
 
Git 들여다보기(1)
Git 들여다보기(1)Git 들여다보기(1)
Git 들여다보기(1)
 
Chuyệ
ChuyệChuyệ
Chuyệ
 
Axx oms backup procedure remotely
Axx oms backup procedure remotelyAxx oms backup procedure remotely
Axx oms backup procedure remotely
 
5 VARIABLES in MANUFACTURING PRODN
5 VARIABLES in MANUFACTURING PRODN5 VARIABLES in MANUFACTURING PRODN
5 VARIABLES in MANUFACTURING PRODN
 
О себе
О себеО себе
О себе
 
Portfolio
PortfolioPortfolio
Portfolio
 
La informática en el periodismo
La informática en el periodismoLa informática en el periodismo
La informática en el periodismo
 
CURRICULUM_VITAE.PDF
CURRICULUM_VITAE.PDFCURRICULUM_VITAE.PDF
CURRICULUM_VITAE.PDF
 

Similar a Winning With Java at Market Open

Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!Azul Systems Inc.
 
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemsEnabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemszuluJDK
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsAzul Systems Inc.
 
JVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodJVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodAzul Systems Inc.
 
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013Azul Systems Inc.
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market OpenAzul Systems Inc.
 
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, PolandAzul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, PolandAzul Systems Inc.
 
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...DiUS
 
How to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for ReliabilityHow to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for ReliabilityAmazon Web Services
 
Understanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryUnderstanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryC4Media
 
DevOps - Chaos Engineering on Kubernetes
DevOps - Chaos Engineering on KubernetesDevOps - Chaos Engineering on Kubernetes
DevOps - Chaos Engineering on KubernetesDavid Hsu
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...mfrancis
 
AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...
AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...
AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...Amazon Web Services
 
Understanding Latency Response Time and Behavior
Understanding Latency Response Time and BehaviorUnderstanding Latency Response Time and Behavior
Understanding Latency Response Time and BehaviorzuluJDK
 
Integration Testing in AEM
Integration Testing in AEMIntegration Testing in AEM
Integration Testing in AEMconnectwebex
 
Tales About Scala Performance
Tales About Scala PerformanceTales About Scala Performance
Tales About Scala PerformanceHaim Yadid
 
The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...
The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...
The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...Amazon Web Services
 
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdfRodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdfAmazon Web Services
 
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVMQCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVMAzul Systems, Inc.
 

Similar a Winning With Java at Market Open (20)

Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
 
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemsEnabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive Applications
 
JVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodJVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the Hood
 
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
 
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, PolandAzul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
 
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
 
How to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for ReliabilityHow to Determine if You Are Well-Architected for Reliability
How to Determine if You Are Well-Architected for Reliability
 
Understanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryUnderstanding Hardware Transactional Memory
Understanding Hardware Transactional Memory
 
DevOps - Chaos Engineering on Kubernetes
DevOps - Chaos Engineering on KubernetesDevOps - Chaos Engineering on Kubernetes
DevOps - Chaos Engineering on Kubernetes
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
 
Are Your Test Cases Fit For Automation?
Are Your Test Cases Fit For Automation?Are Your Test Cases Fit For Automation?
Are Your Test Cases Fit For Automation?
 
AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...
AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...
AWS Summit Sydney 2014 | The Path to Business Agility for Vodafone: How Amazo...
 
Understanding Latency Response Time and Behavior
Understanding Latency Response Time and BehaviorUnderstanding Latency Response Time and Behavior
Understanding Latency Response Time and Behavior
 
Integration Testing in AEM
Integration Testing in AEMIntegration Testing in AEM
Integration Testing in AEM
 
Tales About Scala Performance
Tales About Scala PerformanceTales About Scala Performance
Tales About Scala Performance
 
The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...
The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...
The Path to Business Agility for Vodafone: How Amazon made us "boring" - Sess...
 
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdfRodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
 
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVMQCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
 

Más de Azul Systems, Inc.

Unleash the Power of Apache Cassandra
Unleash the Power of Apache CassandraUnleash the Power of Apache Cassandra
Unleash the Power of Apache CassandraAzul Systems, Inc.
 
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015Azul Systems, Inc.
 
JVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshopJVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshopAzul Systems, Inc.
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?Azul Systems, Inc.
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionAzul Systems, Inc.
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsAzul Systems, Inc.
 

Más de Azul Systems, Inc. (7)

Unleash the Power of Apache Cassandra
Unleash the Power of Apache CassandraUnleash the Power of Apache Cassandra
Unleash the Power of Apache Cassandra
 
How NOT to Measure Latency
How NOT to Measure LatencyHow NOT to Measure Latency
How NOT to Measure Latency
 
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
 
JVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshopJVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshop
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage Collection
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 

Winning With Java at Market Open

  • 1. ©2013 Azul Systems, Inc. Winning with Java At Market Open Getting Fast & Staying Fast Gil Tene, CTO & co-Founder, Azul Systems
  • 2. ©2013 Azul Systems, Inc. Are you fast at Market Open?
  • 3. ©2013 Azul Systems, Inc. Java at Market Open . . . Market Open
  • 4. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality
  • 5. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast
  • 6. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization
  • 7. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case
  • 8. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt
  • 9. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt
  • 10. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt . . .
  • 11. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt Warmup . . .
  • 12. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt Warmup Deoptimization . . .
  • 13. Speculative compiler tricks JIT compilers can do things that static compilers can have a hard time with…
  • 14. ©2012 Azul Systems, Inc. Untaken path example
  • 15. ©2012 Azul Systems, Inc. Untaken path example “Never taken” paths can be optimized away with benefits: void computeMagnitude(int val) { if (val > 10) { bias = computeBias(val); else { bias = 1; } return Math.log10(bias + 99); }
  • 16. ©2012 Azul Systems, Inc. Untaken path example “Never taken” paths can be optimized away with benefits: void computeMagnitude(int val) { if (val > 10) { bias = computeBias(val); else { bias = 1; } return Math.log10(bias + 99); } When all values so far were <= 10 , can be optimized to: void computeMagnitude(int val) { if (val > 10) uncommonTrap(); return 2; }
  • 17. ©2012 Azul Systems, Inc. Implicit Null Check example
  • 18. ©2012 Azul Systems, Inc. Implicit Null Check example All field and array access in Java is null checked x = foo.x; is (in equivalent required machine code): if (foo == null) throw new NullPointerException(); x = foo.x;
  • 19. ©2012 Azul Systems, Inc. Implicit Null Check example All field and array access in Java is null checked x = foo.x; is (in equivalent required machine code): if (foo == null) throw new NullPointerException(); x = foo.x; But compiler can “hope” for non-nulls, and handle SEGV <Point where later SEGV will appear to throw> x = foo.x;
  • 20. ©2012 Azul Systems, Inc. Implicit Null Check example All field and array access in Java is null checked x = foo.x; is (in equivalent required machine code): if (foo == null) throw new NullPointerException(); x = foo.x; But compiler can “hope” for non-nulls, and handle SEGV <Point where later SEGV will appear to throw> x = foo.x; This is faster *IF* no nulls are encountered…
  • 22. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive
  • 23. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative
  • 24. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior
  • 25. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior Can “hope” about things and can recover if wrong
  • 26. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior Can “hope” about things and can recover if wrong Warming up code is a black art
  • 27. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior Can “hope” about things and can recover if wrong Warming up code is a black art Running code long enough to compile is just the start…
  • 28. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior Can “hope” about things and can recover if wrong Warming up code is a black art Running code long enough to compile is just the start… Deoptimization can occur at any time
  • 29. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior Can “hope” about things and can recover if wrong Warming up code is a black art Running code long enough to compile is just the start… Deoptimization can occur at any time often occur after you *think* the code is warmed up.
  • 30. ©2012 Azul Systems, Inc. Deoptimization: Adaptive compilation is… adaptive JIT Compilers are adaptive and speculative Leverage observations of behavior Can “hope” about things and can recover if wrong Warming up code is a black art Running code long enough to compile is just the start… Deoptimization can occur at any time often occur after you *think* the code is warmed up. Deoptimization has many potential causes
  • 31. ©2012 Azul Systems, Inc. Warmup often doesn’t cut it…
  • 32. ©2012 Azul Systems, Inc. Warmup often doesn’t cut it… Common Example: Trading system wants to have the first trade be fast So run 20,000 “fake” messages through the system to warm up let JIT compilers optimize, learn, and deopt before actual trades
  • 33. ©2012 Azul Systems, Inc. Warmup often doesn’t cut it… Common Example: Trading system wants to have the first trade be fast So run 20,000 “fake” messages through the system to warm up let JIT compilers optimize, learn, and deopt before actual trades What really happens Code is written to do different things “if this is a fake message” e.g. “Don’t send to the exchange if this is a fake message” JITs optimize for fake path, including speculatively assuming “fake” First real message through deopts...
  • 34. ©2012 Azul Systems, Inc. A few example causes for depotimization
  • 35. ©2012 Azul Systems, Inc. A few example causes for depotimization Newly encountered code breaking prior assumptions
  • 36. ©2012 Azul Systems, Inc. A few example causes for depotimization Newly encountered code breaking prior assumptions First calls to method in an uninitialized class
  • 37. ©2012 Azul Systems, Inc. A few example causes for depotimization Newly encountered code breaking prior assumptions First calls to method in an uninitialized class First call to a method in a not-yet-loaded class
  • 38. ©2012 Azul Systems, Inc. A few example causes for depotimization Newly encountered code breaking prior assumptions First calls to method in an uninitialized class First call to a method in a not-yet-loaded class Dynamic branch elimination hitting an unexpected path
  • 39. ©2012 Azul Systems, Inc. A few example causes for depotimization Newly encountered code breaking prior assumptions First calls to method in an uninitialized class First call to a method in a not-yet-loaded class Dynamic branch elimination hitting an unexpected path Implicit Null Check hitting a null
  • 40. ©2013 Azul Systems, Inc. Java’s “Just In Time” Reality Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt Warmup Deoptimization . . .
  • 41. ©2013 Azul Systems, Inc. Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt What we have Java’s “Just In Time” Reality
  • 42. ©2013 Azul Systems, Inc. Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt What we have What we want Java’s “Just In Time” Reality
  • 43. ©2013 Azul Systems, Inc. Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt What we have What we want No Slow Ops or Trades Java’s “Just In Time” Reality
  • 44. ©2013 Azul Systems, Inc. Starts slow, learns fast Lazy loading & initialization Aggressively optimized for the common case (temporarily) Reverts to slower execution to adapt What we have What we want No Slow Ops or Trades ReadyNow! to the rescue Java’s “Just In Time” Reality
  • 45. ©2012 Azul Systems, Inc. What can we do about it?
  • 46. ©2012 Azul Systems, Inc. What can we do about it? Azul’s Zing JVM has a feature set called “ReadyNow!” Avoids deoptimization while keeping code fast Allows code to reach optimized levels without requiring “exercise”
  • 47. ©2012 Azul Systems, Inc. What can we do about it? Azul’s Zing JVM has a feature set called “ReadyNow!” Avoids deoptimization while keeping code fast Allows code to reach optimized levels without requiring “exercise” Learning and retaining optimizations With Zing, your next run can learn from the previous one
  • 48. ©2012 Azul Systems, Inc. What can we do about it? Azul’s Zing JVM has a feature set called “ReadyNow!” Avoids deoptimization while keeping code fast Allows code to reach optimized levels without requiring “exercise” Learning and retaining optimizations With Zing, your next run can learn from the previous one Fine grained control options Per method compiler directives …
  • 49. ©2012 Azul Systems, Inc. Logging & “replaying”optimizations
  • 50. ©2012 Azul Systems, Inc. Logging & “replaying”optimizations Zing’s ReadyNow includes optimization logging Records ongoing optimization decisions and stats records optimization dependencies Establishes “stable optimization state” at end of previous run
  • 51. ©2012 Azul Systems, Inc. Logging & “replaying”optimizations Zing’s ReadyNow includes optimization logging Records ongoing optimization decisions and stats records optimization dependencies Establishes “stable optimization state” at end of previous run Zing can then read prior logs at startup Prime JVM with knowledge of prior stable optimizations Optimizations are applied as their dependencies get resolved
  • 52. ©2012 Azul Systems, Inc. Logging & “replaying”optimizations Zing’s ReadyNow includes optimization logging Records ongoing optimization decisions and stats records optimization dependencies Establishes “stable optimization state” at end of previous run Zing can then read prior logs at startup Prime JVM with knowledge of prior stable optimizations Optimizations are applied as their dependencies get resolved ReadyNow workflow promotes confidence You’ll know if/when all optimizations have been applied If some optimization haven’t been applied, you’ll know why…
  • 53. ©2013 Azul Systems, Inc. Java at “Load Start” . . . Load Start
  • 54. ©2013 Azul Systems, Inc. Java at “Load Start” . . . Load Start Deoptimization
  • 55. ©2013 Azul Systems, Inc. Java at “Load Start” . . . Load Start Deoptimization ReadyNow! avoids deoptimization
  • 56. ©2013 Azul Systems, Inc. Java at “Load Start” . . . Load Start With Zing & ReadyNow!
  • 57. ©2013 Azul Systems, Inc. Java at “Load Start” . . . Load Start With ReadyNow! Warmup?
  • 58. ©2013 Azul Systems, Inc. Java at “Load Start” . . . Load Start With ReadyNow! Warmup? Fast From The Start
  • 59. ©2013 Azul Systems, Inc. . . . Load Start With ReadyNow! and Start Fast & Stay Fast Java at “Load Start”
  • 60. ©2013 Azul Systems, Inc. . . . Load Start With Zing & ReadyNow! Start Fast & Stay Fast Java at “Load Start”
  • 61. ©2013 Azul Systems, Inc. . . . Load Start With Zing & ReadyNow! Start Fast & Stay Fast Java at “Load Start”
  • 62. ©2013 Azul Systems, Inc. . . . Load Start With Zing & ReadyNow! Start Fast & Stay Fast Java at “Load Start” With Confidence
  • 63. ©2013 Azul Systems, Inc. One liner takeaway . . . Load Start
  • 64. ©2013 Azul Systems, Inc. One liner takeaway . . . Zing: A cure for the Java hiccups Load Start