SlideShare a Scribd company logo
1 of 92
Ahead-Of-Time Compilation
of Java Applications
1
Nikita Lipsky
Excelsior LLC
Once upon a time,
when C++ was new and cool,
+++++++++
2
Once upon a time,
when C++ was new and cool,
+++++++++
3
Once upon a time,
when C++ was new and cool,
all compilers were static
4
Until into this world came…
Java
5
Until into this world came…
Java
6
Two Ways To Execute Java Bytecode
• Interpret
Slow but portable
• Compile to native code
Runs on the actual hardware
7
When to compile to native code?
• At application run time
Dynamic (Just-In-Time, JIT) Compilation
• Before the application is launched/deployed
Static (Ahead-Of-Time, AOT) Compilation
8
9
Static compilation of Java
• Is it at all possible?
– If yes, what are the conditions and would it still be Java?
• What are the benefits?
– Obfuscation vs. static compilation
– Application startup
– Smaller installers with no external dependencies
– Performance: comparison with JIT compilation
– Why is AOT better for Desktop, Embedded, Mobile
– Are there any benefits for server-side apps?
10
Nikita Lipsky
• 20+ years in software development
• Excelsior JET project initiator
– 16+ years of contributions
– compiler engineer
– team lead
– product lead
– etc.
• Open source projects WebFX and Java ReStart
– in a spare time
• Twitter: @pjBooms
11
12
Who needs Java AOT
13
Кто знает про Excelsior JET?Кто знает про Excelsior JET?
Java AOT Compilation Myths
14
Myth 1. Java is “too dynamic”
Reflection Dynamic class loading
15
Myth 2. AOT kills WORA
WORA
Write Once
Run Anywhere
BORA
Build Once
Run Anywhere
16
!=
Myth 3. AOT = Small EXE
”I would get a small executable that works
without a JVM (as if I wrote my app in C)”
17
Myth 3. AOT = Small EXE
• What about thousands of standard classes?
• Who will collect the garbage?
• What about reflection?
18
AOT = Smaller Package
Yes, AOT compilation can help you create
a JRE-independent installer smaller than the JRE
installer alone
Javа Runtime Slim-Down:
www.excelsiorjet.com/solutions/java-download-size
19
Java IS “too dynamic”
20
Non-standard Class Loaders
• Override the default reference resolution logic
• Unique namespaces
• Dependency management frameworks
– OSGi, Java Module System, etc.
Solve JAR hell problem
• Java EE servers, Eclipse RCP, plugin architectures
21
Non-standard Class Loaders
How to compile such classes statically?
• Compile each class in isolation
– Bad for performance
• Reproduce reference resolution logic of popular
class loaders
– Does not work for arbitrary class loaders
22
Non-standard Class Loaders
23
Classes
Classe
sClasses
Classes
CL1
CL2
CL3
CL4
Non-standard Class Loaders
24CLi: class loader
• CL4• CL3
• CL2• CL1
classes classes
classesclasses
Non-standard Class Loaders
25
• CL4• CL3
• CL2• CL1
classes
classes
classesclasses
Non-standard Class Loaders
26
• CL4• CL3
• CL2• CL1
classes classes
classesclasses
Non-standard Class Loaders
27
Non-standard Class Loaders
28
• CL4• CL3
• CL2• CL1
classes classes
classes
• CL4• CL3
• CL2• CL1
classes classes
Non-standard Class Loaders
29
Non-standard Class Loaders
AOT class loader support scheme:
• Reference resolver in the AOT compiler:
– Determines which class loaders will be created at
run time and assigns a static ID to each
– Breaks down the set of classes by class loader IDs
– Resolves references between classes
30
Non-standard Class Loaders
AOT class loader support scheme contd.:
• At application run time:
– For each class loader instance, compute its ID
– Knowing the ID, “load” the precompiled classes:
• Create a java.lang.Class instance
• Fill it with reflection information
• Let the O/S load code from the executable
31
Non-standard Class Loaders
AOT class loader support scheme contd.:
• At application run time:
– For each class loader instance, compute its ID
– Knowing the ID, “load” the precompiled classes
Known to work for Eclipse RCP
and Tomcat Web apps
32
Why AOT for Java?
33
Protect Code from Decompilers
34
Application Code Protection
• Bytecode emitted by javac is extremely easy to
decompile almost to original source
Proof: http://bytecodeviewer.com/
• Reflection makes name obfuscation labor-
consuming and error prone, hinders code
maintenance
• Possible to guess what obfuscated code does
References to JDK classes remain intact
35
Application Code Protection
• Native machine code can only be effectively
disassembled, but not decompiled
• Application structure not deductible
from disassembler output
• Aggressively optimized native code only
remotely resembles original
36
Application Startup Time
37
Cold Start vs Warm Start
Why a re-started application starts much faster?
– No need to load app code and data from disk
– No need to load system/third-party dynamic
libraries (.DLL, .so) either
38
AOT Is Faster?
• Native code is “thicker” than Java bytecode
• Reading code from disk often takes more
time than its execution, esp. on cold starts
39
AOT IS Faster!
1. Identify code that gets executed on startup
2. Place it at the beginning of the executable
3. Preload the entire “startup segment” in one
sequential read (Makes most difference on rotating media,
slow USB sticks, etc., not so much on SSDs)
40
41
Performance
42
Myth 4. AOT Is Faster
“By compiling Java statically, we are making it
equivalent to C, C is faster than Java,
therefore statically compiled Java is faster”
43
Myth 5. JIT Is Faster
“Effective optimization of a Java application
is only possible in the presence
of its dynamic execution profile”
44
Compiler Optimizations
– Constant propagation
– Dead code elimination
– Common subexpression
elimination
– Inline substitution
– Method specialization
– Loop unrolling
– Loop versioning
– Loop-invariant code motion
– Tail recursion elimination
– Call devirtualization
– On-stack allocation and
explosion of objects
– Runtime checks removal
– Excess synchronization removal
– Optimal code selection and
bundling
– Instruction scheduling
– Optimal register allocation
– etc.
45
Java == OOP
• Lots of methods
• Lots of small methods (get/set)
• Lots of virtual calls of small methods
46
Call Devirtualization
• Precondition for subsequent inline substitution
• Class hierarchy analysis
Method not overridden => non-virtual call
• Type analysis
new T().foo(); // Non-virtual
// call of T.foo()
• Inline caches
47
A a;
…
a.foo(); 
if (RT_Type(a) in CHA) {
inlined body of foo()
} else {
a.foo();
}
Idea: method not overriden => non-virtual call
Class Hierarchy Analysis (CHA)
48
Type Analysis
Idea:
new A().foo(); // non-virtual call. Always!
49
Type Analysis
A a = b ? new B() : new C();
a.foo();// is it virtual call?
// B, C extend A and do not override A.foo
50
Type Analysis
A a = b ? new B() : new C();
a.foo();
If neither B nor С override A.foo(),
then a.foo()is a non-virtual call again!
(can be inlined)
51
Type Analysis
A a = b ? bar() : baz();
…
a.foo();
If bar() only returns results of new B,
and baz() - only returns results of new С,
then a.foo() is again non-virtual
(can be inlined)
52
Type Analysis
How do we know
what bar() and baz() return?
53
Global Analysis
• Analyses all methods of the program, computing
useful information about each
– whether a method always returns new T();
– whether an argument of a method does not escape to
a shared memory
• Results are then used for optimization of each
particular method
54
Stack Allocation of Objects
• All Java objects are supposed to reside in dynamic
memory – on the Java heap
• But, most objects are small and temporary
• It is desirable to allocate them on the stack
Escape analysis determines whether a locally
created object escapes from the method
stack frame into shared memory
55
Example
for (Object o: getCollection()) {
doSomething(o);
}
56
Example
Iterator iter = getCollection().iterator();
while (iter.hasNext()) {
Object o = iter.next();
doSomething(o);
}
57
Example
Suppose analysis has shown that getCollection()
always returns an ArrayList
ArrayList list = getCollection();
Iterator iter = list.iterator();
while (iter.hasNext()) {
Object o = iter.next();
doSomething(o);
}
58
Example
ArrayList list = getCollection();
ArrayList.ListItr iter = new ListItr(list);
while (iter.hasNext()) {
Object o = iter.next();
doSomething(o);
}
59
Example
ArrayList list = getCollection();
ArrayList.ListItr iter = onStack ListItr();
iter.this$0 = list;
iter.cursor = 0;
iter.size = list.elemData.length;
while (iter.hasNext()) {
Object o = iter.next();
doSomething(o);
}
60
Example
ArrayList list = getCollection();
ArrayList.ListItr iter = onStack ListItr(list);
iter.this$0 = list;
iter.cursor = 0;
iter.size = list.elemData.length;
while (iter.cursor < iter.size) {
int index = iter.cursor++;
Object o = iter.this$0.elemData[index];
doSomething(o);
}
61
Example
ArrayList list = getCollection();
int cursor = 0;
int size = list.elemData.length;
while (cursor < size) {
Object o = list.elemData[cursor++];
doSomething(o);
}
62
Example
ArrayList list = getCollection();
int size = list.elemData.length;
for (int i = 0; i < size; i++) {
doSomething(list.elemData[i]);
}
63
Analysis & Optimizations…
• …are often quite complicated
• …require iterative re-computation
• …, if global, depend on the entire program
64
Analysis & Optimizations…
• …are often quite complicated
• …require iterative recomputation
• …, if global, depend on the entire program
Can a JIT compiler afford
all or any of that?
65
Analysis & Optimizations…
• …are often quite complicated
• …require iterative recomputations
• …, if global, depend on the entire program
Can a JIT compiler afford
all or any of that?
66
Analysis & Optimizations…
• …are often quite complicated
• …require iterative recomputations
• …, if global, depend on the entire program
Can a JIT compiler afford
all or any of that?
67
Dynamic Optimizations
• Profiling and selective compilation
• Inline substitution based on execution profile
• Hot execution traces optimization
• Optimal instruction selection
68
Hot Code vs Warm Code
Q: What happens when an app with no
distinctly hot code runs on a typical JVM?
A: Long warmup with results not stored
for future reuse
Typical case: UI-centric applications
69
JFCMark (Short Run)
0%
50%
100%
150%
200%
250%
2 core Celeron, 2.60Ghz 4 core i5, 3.8GZ
Excelsior JET
HotSpot client
HotSpot server
Bigger – better
70
JFCMark (Long Run)
0%
20%
40%
60%
80%
100%
120%
140%
160%
2 core Celeron, 2.60Ghz 4 core i5, 3.8GZ
Excelsior JET
HotSpot client
HotSpot server
71
Bigger – better
Profile Guided Optimizations
Can a static compiler use
dynamic execution profiles as input?
72
Server side
• CPU time in the cloud costs
money
• After some time, execution profile of a server app
stabilizes
• Why not pass it over to the AOT compiler?
73
AOT on the Server side
• Stable performance and predictable latency
– no code de-optimizations occur at run-time
• Work at full speed right from the start
– good for load balancing
• Better startup time
– good when many servers start simultaneously
• Still protects the code from decompilation
74
Embedded/IoT
• The less powerful the hardware, the more
expensive dynamic compilation becomes
• Embedded systems typically have less
computing power than desktops and servers
75
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
What is missing?
76
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
What is missing?
77
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
What is missing?
78
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
What is missing?
79
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
What is missing?
80
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
What is missing?
81
Mobile
• JVM on Mobile:
– Platform classes
– Memory Manager and GC
– Reflection
– JIT Compiler
Charger!
82
Mobile
• Wireless devices have batteries
• Does it make sense to spend power on
dynamic compilation?
83
iOS
• iOS policy prohibits creation of any native
code during application run time
• Getting Java apps to work on iOS requires
either an interpreting JVM or an AOT compiler
84
AOT Java Compilers in 2000
Desktop/Server:
BulletTrain
Excelsior JET
GNU Compiler for Java (GCJ)
IBM VisualAge for Java
Supercede/JOVE
TowerJ
Embedded/Mobile:
Diab FastJ
Esmertec Jbed ME
GCJ
IBM J9
Sun Java ME
(custom offerings)
85
AOT Java Compilers in 2016
Desktop/Server:
Excelsior JET
GCJ
IBM Java SDK for AIX
IBM Java SDK for z/OS
Embedded:
Excelsior JET Embedded
IBM WebSphere Real Time
Oracle Java ME Embedded Client
Codename One
Avian
Android ART
RoboVM (RIP)
Migeran (acquired by Intel)
86
87
Static compilation of Java apps:
88
Static compilation of Java apps:
89
Possible
Static compilation of Java apps:
90
Possible
Preserving all Java features
Static compilation of Java apps:
91
Possible
Preserving all Java features
Useful in many aspects
Q & A
Nikita Lipsky,
Excelsior
nlipsky@excelsior-usa.com
twitter: @pjBooms 92

More Related Content

What's hot

Java bytecode and classes
Java bytecode and classesJava bytecode and classes
Java bytecode and classesyoavwix
 
Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Anton Arhipov
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx FranceDavid Delabassee
 
Understanding Java Dynamic Proxies
Understanding Java Dynamic ProxiesUnderstanding Java Dynamic Proxies
Understanding Java Dynamic ProxiesRafael Luque Leiva
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)JiandSon
 
Mastering java bytecode with ASM - GeeCON 2012
Mastering java bytecode with ASM - GeeCON 2012Mastering java bytecode with ASM - GeeCON 2012
Mastering java bytecode with ASM - GeeCON 2012Anton Arhipov
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011Charles Nutter
 
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Anton Arhipov
 
Java 8 and beyond, a scala story
Java 8 and beyond, a scala storyJava 8 and beyond, a scala story
Java 8 and beyond, a scala storyittaiz
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Christian Schneider
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7Deniz Oguz
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineChun-Yu Wang
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeOmar Bashir
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsCS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsKwangshin Oh
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Charles Nutter
 

What's hot (20)

Java bytecode and classes
Java bytecode and classesJava bytecode and classes
Java bytecode and classes
 
Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France
 
Understanding Java Dynamic Proxies
Understanding Java Dynamic ProxiesUnderstanding Java Dynamic Proxies
Understanding Java Dynamic Proxies
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 
Mastering java bytecode with ASM - GeeCON 2012
Mastering java bytecode with ASM - GeeCON 2012Mastering java bytecode with ASM - GeeCON 2012
Mastering java bytecode with ASM - GeeCON 2012
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Dynamic Proxy by Java
Dynamic Proxy by JavaDynamic Proxy by Java
Dynamic Proxy by Java
 
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
 
Java 8 and beyond, a scala story
Java 8 and beyond, a scala storyJava 8 and beyond, a scala story
Java 8 and beyond, a scala story
 
Eval4j @ JVMLS 2014
Eval4j @ JVMLS 2014Eval4j @ JVMLS 2014
Eval4j @ JVMLS 2014
 
What's new in Java 11
What's new in Java 11What's new in Java 11
What's new in Java 11
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
JAVA BYTE CODE
JAVA BYTE CODEJAVA BYTE CODE
JAVA BYTE CODE
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
 
Smart Migration to JDK 8
Smart Migration to JDK 8Smart Migration to JDK 8
Smart Migration to JDK 8
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and Runtime
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsCS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 

Similar to Ahead-Of-Time Compilation of Java Applications

Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
JavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for DummiesJavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for DummiesCharles Nutter
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesAlexandra Masterson
 
C++ in kernel mode
C++ in kernel modeC++ in kernel mode
C++ in kernel modecorehard_by
 
Tips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeTips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeKenneth Geisshirt
 
Efficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode DetectionEfficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode DetectionGeorg Wicherski
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...chen yuki
 
Memory Management with Java and C++
Memory Management with Java and C++Memory Management with Java and C++
Memory Management with Java and C++Mohammad Shaker
 
White and Black Magic on the JVM
White and Black Magic on the JVMWhite and Black Magic on the JVM
White and Black Magic on the JVMIvaylo Pashov
 
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...Miro Wengner
 
Lifecycle of a JIT compiled code
Lifecycle of a JIT compiled codeLifecycle of a JIT compiled code
Lifecycle of a JIT compiled codeJ On The Beach
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediZeroTurnaround
 
Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Kenneth Geisshirt
 
Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...
Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...
Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...Charles Nutter
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandDown the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandCharles Nutter
 
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
"JIT compiler overview" @ JEEConf 2013, Kiev, UkraineVladimir Ivanov
 
Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Lucas Leong
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013Vladimir Ivanov
 

Similar to Ahead-Of-Time Compilation of Java Applications (20)

Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
JavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for DummiesJavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for Dummies
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
 
C++ in kernel mode
C++ in kernel modeC++ in kernel mode
C++ in kernel mode
 
Tips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeTips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native code
 
Efficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode DetectionEfficient Bytecode Analysis: Linespeed Shellcode Detection
Efficient Bytecode Analysis: Linespeed Shellcode Detection
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
 
Memory Management with Java and C++
Memory Management with Java and C++Memory Management with Java and C++
Memory Management with Java and C++
 
White and Black Magic on the JVM
White and Black Magic on the JVMWhite and Black Magic on the JVM
White and Black Magic on the JVM
 
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
 
Lifecycle of a JIT compiled code
Lifecycle of a JIT compiled codeLifecycle of a JIT compiled code
Lifecycle of a JIT compiled code
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
 
Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++
 
Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...
Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...
Øredev 2011 - JVM JIT for Dummies (What the JVM Does With Your Bytecode When ...
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM WonderlandDown the Rabbit Hole: An Adventure in JVM Wonderland
Down the Rabbit Hole: An Adventure in JVM Wonderland
 
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
 
Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013
 
De Java 8 ate Java 14
De Java 8 ate Java 14De Java 8 ate Java 14
De Java 8 ate Java 14
 
De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14
 

More from Nikita Lipsky

Escaping The Jar hell with Jigsaw Layers
Escaping The Jar hell with Jigsaw LayersEscaping The Jar hell with Jigsaw Layers
Escaping The Jar hell with Jigsaw LayersNikita Lipsky
 
Java 9 Modules: The Duke Yet Lives That OSGi Shall Depose
Java 9 Modules: The Duke Yet Lives That OSGi Shall DeposeJava 9 Modules: The Duke Yet Lives That OSGi Shall Depose
Java 9 Modules: The Duke Yet Lives That OSGi Shall DeposeNikita Lipsky
 
Java 9 Модули. Почему не OSGi?
Java 9 Модули. Почему не OSGi?Java 9 Модули. Почему не OSGi?
Java 9 Модули. Почему не OSGi?Nikita Lipsky
 
AOT для Java: Мифы и Challenges
AOT для Java: Мифы и ChallengesAOT для Java: Мифы и Challenges
AOT для Java: Мифы и ChallengesNikita Lipsky
 
Верификация Java байткода: когда, как, а может отключить?
Верификация Java байткода: когда, как, а может отключить?Верификация Java байткода: когда, как, а может отключить?
Верификация Java байткода: когда, как, а может отключить?Nikita Lipsky
 
Java 8 Support at the JVM Level
Java 8 Support at the JVM LevelJava 8 Support at the JVM Level
Java 8 Support at the JVM LevelNikita Lipsky
 
JVM: краткий курс общей анатомии, JPoint 2016 Conference Edition
JVM: краткий курс общей анатомии, JPoint 2016 Conference EditionJVM: краткий курс общей анатомии, JPoint 2016 Conference Edition
JVM: краткий курс общей анатомии, JPoint 2016 Conference EditionNikita Lipsky
 
Поддержка Java 8 в Excelsior JET
Поддержка Java 8 в Excelsior JET Поддержка Java 8 в Excelsior JET
Поддержка Java 8 в Excelsior JET Nikita Lipsky
 
JVM: краткий курс общей анатомии
JVM: краткий курс общей анатомииJVM: краткий курс общей анатомии
JVM: краткий курс общей анатомииNikita Lipsky
 
Клиентская Java вне браузера. Делаем нативные клиенты на Java
Клиентская Java вне браузера. Делаем нативные клиенты на JavaКлиентская Java вне браузера. Делаем нативные клиенты на Java
Клиентская Java вне браузера. Делаем нативные клиенты на JavaNikita Lipsky
 
Delivering Native User Experience In Client Side Java Applications
Delivering Native User Experience In Client Side Java ApplicationsDelivering Native User Experience In Client Side Java Applications
Delivering Native User Experience In Client Side Java ApplicationsNikita Lipsky
 
Java Restart with WebFX
Java Restart with WebFX Java Restart with WebFX
Java Restart with WebFX Nikita Lipsky
 
Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...
Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...
Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...Nikita Lipsky
 
Java Ahead-Of-Time compilation
Java Ahead-Of-Time compilationJava Ahead-Of-Time compilation
Java Ahead-Of-Time compilationNikita Lipsky
 
Excelsior JET в действии
Excelsior JET в действииExcelsior JET в действии
Excelsior JET в действииNikita Lipsky
 
Веб 3.0. Есть ли будущее у Java в RIA и Mobile?
Веб 3.0. Есть ли будущее у Java в RIA и Mobile?Веб 3.0. Есть ли будущее у Java в RIA и Mobile?
Веб 3.0. Есть ли будущее у Java в RIA и Mobile?Nikita Lipsky
 
Занимательные истории из жизни технической поддержки JVM
Занимательные истории из жизни технической поддержки JVMЗанимательные истории из жизни технической поддержки JVM
Занимательные истории из жизни технической поддержки JVMNikita Lipsky
 
Неумолимая близость десктопа, веба и мобайла
Неумолимая близость десктопа, веба и мобайлаНеумолимая близость десктопа, веба и мобайла
Неумолимая близость десктопа, веба и мобайлаNikita Lipsky
 
Java худеет. Спроси меня как.
Java худеет. Спроси меня как.Java худеет. Спроси меня как.
Java худеет. Спроси меня как.Nikita Lipsky
 
История одной JVM в картинках
История одной JVM в картинкахИстория одной JVM в картинках
История одной JVM в картинкахNikita Lipsky
 

More from Nikita Lipsky (20)

Escaping The Jar hell with Jigsaw Layers
Escaping The Jar hell with Jigsaw LayersEscaping The Jar hell with Jigsaw Layers
Escaping The Jar hell with Jigsaw Layers
 
Java 9 Modules: The Duke Yet Lives That OSGi Shall Depose
Java 9 Modules: The Duke Yet Lives That OSGi Shall DeposeJava 9 Modules: The Duke Yet Lives That OSGi Shall Depose
Java 9 Modules: The Duke Yet Lives That OSGi Shall Depose
 
Java 9 Модули. Почему не OSGi?
Java 9 Модули. Почему не OSGi?Java 9 Модули. Почему не OSGi?
Java 9 Модули. Почему не OSGi?
 
AOT для Java: Мифы и Challenges
AOT для Java: Мифы и ChallengesAOT для Java: Мифы и Challenges
AOT для Java: Мифы и Challenges
 
Верификация Java байткода: когда, как, а может отключить?
Верификация Java байткода: когда, как, а может отключить?Верификация Java байткода: когда, как, а может отключить?
Верификация Java байткода: когда, как, а может отключить?
 
Java 8 Support at the JVM Level
Java 8 Support at the JVM LevelJava 8 Support at the JVM Level
Java 8 Support at the JVM Level
 
JVM: краткий курс общей анатомии, JPoint 2016 Conference Edition
JVM: краткий курс общей анатомии, JPoint 2016 Conference EditionJVM: краткий курс общей анатомии, JPoint 2016 Conference Edition
JVM: краткий курс общей анатомии, JPoint 2016 Conference Edition
 
Поддержка Java 8 в Excelsior JET
Поддержка Java 8 в Excelsior JET Поддержка Java 8 в Excelsior JET
Поддержка Java 8 в Excelsior JET
 
JVM: краткий курс общей анатомии
JVM: краткий курс общей анатомииJVM: краткий курс общей анатомии
JVM: краткий курс общей анатомии
 
Клиентская Java вне браузера. Делаем нативные клиенты на Java
Клиентская Java вне браузера. Делаем нативные клиенты на JavaКлиентская Java вне браузера. Делаем нативные клиенты на Java
Клиентская Java вне браузера. Делаем нативные клиенты на Java
 
Delivering Native User Experience In Client Side Java Applications
Delivering Native User Experience In Client Side Java ApplicationsDelivering Native User Experience In Client Side Java Applications
Delivering Native User Experience In Client Side Java Applications
 
Java Restart with WebFX
Java Restart with WebFX Java Restart with WebFX
Java Restart with WebFX
 
Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...
Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...
Java худеет. Спроси меня как. Уменьшение размера дистрибутива Java приложения...
 
Java Ahead-Of-Time compilation
Java Ahead-Of-Time compilationJava Ahead-Of-Time compilation
Java Ahead-Of-Time compilation
 
Excelsior JET в действии
Excelsior JET в действииExcelsior JET в действии
Excelsior JET в действии
 
Веб 3.0. Есть ли будущее у Java в RIA и Mobile?
Веб 3.0. Есть ли будущее у Java в RIA и Mobile?Веб 3.0. Есть ли будущее у Java в RIA и Mobile?
Веб 3.0. Есть ли будущее у Java в RIA и Mobile?
 
Занимательные истории из жизни технической поддержки JVM
Занимательные истории из жизни технической поддержки JVMЗанимательные истории из жизни технической поддержки JVM
Занимательные истории из жизни технической поддержки JVM
 
Неумолимая близость десктопа, веба и мобайла
Неумолимая близость десктопа, веба и мобайлаНеумолимая близость десктопа, веба и мобайла
Неумолимая близость десктопа, веба и мобайла
 
Java худеет. Спроси меня как.
Java худеет. Спроси меня как.Java худеет. Спроси меня как.
Java худеет. Спроси меня как.
 
История одной JVM в картинках
История одной JVM в картинкахИстория одной JVM в картинках
История одной JVM в картинках
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Ahead-Of-Time Compilation of Java Applications

  • 1. Ahead-Of-Time Compilation of Java Applications 1 Nikita Lipsky Excelsior LLC
  • 2. Once upon a time, when C++ was new and cool, +++++++++ 2
  • 3. Once upon a time, when C++ was new and cool, +++++++++ 3
  • 4. Once upon a time, when C++ was new and cool, all compilers were static 4
  • 5. Until into this world came… Java 5
  • 6. Until into this world came… Java 6
  • 7. Two Ways To Execute Java Bytecode • Interpret Slow but portable • Compile to native code Runs on the actual hardware 7
  • 8. When to compile to native code? • At application run time Dynamic (Just-In-Time, JIT) Compilation • Before the application is launched/deployed Static (Ahead-Of-Time, AOT) Compilation 8
  • 9. 9
  • 10. Static compilation of Java • Is it at all possible? – If yes, what are the conditions and would it still be Java? • What are the benefits? – Obfuscation vs. static compilation – Application startup – Smaller installers with no external dependencies – Performance: comparison with JIT compilation – Why is AOT better for Desktop, Embedded, Mobile – Are there any benefits for server-side apps? 10
  • 11. Nikita Lipsky • 20+ years in software development • Excelsior JET project initiator – 16+ years of contributions – compiler engineer – team lead – product lead – etc. • Open source projects WebFX and Java ReStart – in a spare time • Twitter: @pjBooms 11
  • 12. 12
  • 13. Who needs Java AOT 13 Кто знает про Excelsior JET?Кто знает про Excelsior JET?
  • 15. Myth 1. Java is “too dynamic” Reflection Dynamic class loading 15
  • 16. Myth 2. AOT kills WORA WORA Write Once Run Anywhere BORA Build Once Run Anywhere 16 !=
  • 17. Myth 3. AOT = Small EXE ”I would get a small executable that works without a JVM (as if I wrote my app in C)” 17
  • 18. Myth 3. AOT = Small EXE • What about thousands of standard classes? • Who will collect the garbage? • What about reflection? 18
  • 19. AOT = Smaller Package Yes, AOT compilation can help you create a JRE-independent installer smaller than the JRE installer alone Javа Runtime Slim-Down: www.excelsiorjet.com/solutions/java-download-size 19
  • 20. Java IS “too dynamic” 20
  • 21. Non-standard Class Loaders • Override the default reference resolution logic • Unique namespaces • Dependency management frameworks – OSGi, Java Module System, etc. Solve JAR hell problem • Java EE servers, Eclipse RCP, plugin architectures 21
  • 22. Non-standard Class Loaders How to compile such classes statically? • Compile each class in isolation – Bad for performance • Reproduce reference resolution logic of popular class loaders – Does not work for arbitrary class loaders 22
  • 25. • CL4• CL3 • CL2• CL1 classes classes classesclasses Non-standard Class Loaders 25
  • 26. • CL4• CL3 • CL2• CL1 classes classes classesclasses Non-standard Class Loaders 26
  • 27. • CL4• CL3 • CL2• CL1 classes classes classesclasses Non-standard Class Loaders 27
  • 28. Non-standard Class Loaders 28 • CL4• CL3 • CL2• CL1 classes classes classes
  • 29. • CL4• CL3 • CL2• CL1 classes classes Non-standard Class Loaders 29
  • 30. Non-standard Class Loaders AOT class loader support scheme: • Reference resolver in the AOT compiler: – Determines which class loaders will be created at run time and assigns a static ID to each – Breaks down the set of classes by class loader IDs – Resolves references between classes 30
  • 31. Non-standard Class Loaders AOT class loader support scheme contd.: • At application run time: – For each class loader instance, compute its ID – Knowing the ID, “load” the precompiled classes: • Create a java.lang.Class instance • Fill it with reflection information • Let the O/S load code from the executable 31
  • 32. Non-standard Class Loaders AOT class loader support scheme contd.: • At application run time: – For each class loader instance, compute its ID – Knowing the ID, “load” the precompiled classes Known to work for Eclipse RCP and Tomcat Web apps 32
  • 33. Why AOT for Java? 33
  • 34. Protect Code from Decompilers 34
  • 35. Application Code Protection • Bytecode emitted by javac is extremely easy to decompile almost to original source Proof: http://bytecodeviewer.com/ • Reflection makes name obfuscation labor- consuming and error prone, hinders code maintenance • Possible to guess what obfuscated code does References to JDK classes remain intact 35
  • 36. Application Code Protection • Native machine code can only be effectively disassembled, but not decompiled • Application structure not deductible from disassembler output • Aggressively optimized native code only remotely resembles original 36
  • 38. Cold Start vs Warm Start Why a re-started application starts much faster? – No need to load app code and data from disk – No need to load system/third-party dynamic libraries (.DLL, .so) either 38
  • 39. AOT Is Faster? • Native code is “thicker” than Java bytecode • Reading code from disk often takes more time than its execution, esp. on cold starts 39
  • 40. AOT IS Faster! 1. Identify code that gets executed on startup 2. Place it at the beginning of the executable 3. Preload the entire “startup segment” in one sequential read (Makes most difference on rotating media, slow USB sticks, etc., not so much on SSDs) 40
  • 41. 41
  • 43. Myth 4. AOT Is Faster “By compiling Java statically, we are making it equivalent to C, C is faster than Java, therefore statically compiled Java is faster” 43
  • 44. Myth 5. JIT Is Faster “Effective optimization of a Java application is only possible in the presence of its dynamic execution profile” 44
  • 45. Compiler Optimizations – Constant propagation – Dead code elimination – Common subexpression elimination – Inline substitution – Method specialization – Loop unrolling – Loop versioning – Loop-invariant code motion – Tail recursion elimination – Call devirtualization – On-stack allocation and explosion of objects – Runtime checks removal – Excess synchronization removal – Optimal code selection and bundling – Instruction scheduling – Optimal register allocation – etc. 45
  • 46. Java == OOP • Lots of methods • Lots of small methods (get/set) • Lots of virtual calls of small methods 46
  • 47. Call Devirtualization • Precondition for subsequent inline substitution • Class hierarchy analysis Method not overridden => non-virtual call • Type analysis new T().foo(); // Non-virtual // call of T.foo() • Inline caches 47
  • 48. A a; … a.foo();  if (RT_Type(a) in CHA) { inlined body of foo() } else { a.foo(); } Idea: method not overriden => non-virtual call Class Hierarchy Analysis (CHA) 48
  • 49. Type Analysis Idea: new A().foo(); // non-virtual call. Always! 49
  • 50. Type Analysis A a = b ? new B() : new C(); a.foo();// is it virtual call? // B, C extend A and do not override A.foo 50
  • 51. Type Analysis A a = b ? new B() : new C(); a.foo(); If neither B nor С override A.foo(), then a.foo()is a non-virtual call again! (can be inlined) 51
  • 52. Type Analysis A a = b ? bar() : baz(); … a.foo(); If bar() only returns results of new B, and baz() - only returns results of new С, then a.foo() is again non-virtual (can be inlined) 52
  • 53. Type Analysis How do we know what bar() and baz() return? 53
  • 54. Global Analysis • Analyses all methods of the program, computing useful information about each – whether a method always returns new T(); – whether an argument of a method does not escape to a shared memory • Results are then used for optimization of each particular method 54
  • 55. Stack Allocation of Objects • All Java objects are supposed to reside in dynamic memory – on the Java heap • But, most objects are small and temporary • It is desirable to allocate them on the stack Escape analysis determines whether a locally created object escapes from the method stack frame into shared memory 55
  • 56. Example for (Object o: getCollection()) { doSomething(o); } 56
  • 57. Example Iterator iter = getCollection().iterator(); while (iter.hasNext()) { Object o = iter.next(); doSomething(o); } 57
  • 58. Example Suppose analysis has shown that getCollection() always returns an ArrayList ArrayList list = getCollection(); Iterator iter = list.iterator(); while (iter.hasNext()) { Object o = iter.next(); doSomething(o); } 58
  • 59. Example ArrayList list = getCollection(); ArrayList.ListItr iter = new ListItr(list); while (iter.hasNext()) { Object o = iter.next(); doSomething(o); } 59
  • 60. Example ArrayList list = getCollection(); ArrayList.ListItr iter = onStack ListItr(); iter.this$0 = list; iter.cursor = 0; iter.size = list.elemData.length; while (iter.hasNext()) { Object o = iter.next(); doSomething(o); } 60
  • 61. Example ArrayList list = getCollection(); ArrayList.ListItr iter = onStack ListItr(list); iter.this$0 = list; iter.cursor = 0; iter.size = list.elemData.length; while (iter.cursor < iter.size) { int index = iter.cursor++; Object o = iter.this$0.elemData[index]; doSomething(o); } 61
  • 62. Example ArrayList list = getCollection(); int cursor = 0; int size = list.elemData.length; while (cursor < size) { Object o = list.elemData[cursor++]; doSomething(o); } 62
  • 63. Example ArrayList list = getCollection(); int size = list.elemData.length; for (int i = 0; i < size; i++) { doSomething(list.elemData[i]); } 63
  • 64. Analysis & Optimizations… • …are often quite complicated • …require iterative re-computation • …, if global, depend on the entire program 64
  • 65. Analysis & Optimizations… • …are often quite complicated • …require iterative recomputation • …, if global, depend on the entire program Can a JIT compiler afford all or any of that? 65
  • 66. Analysis & Optimizations… • …are often quite complicated • …require iterative recomputations • …, if global, depend on the entire program Can a JIT compiler afford all or any of that? 66
  • 67. Analysis & Optimizations… • …are often quite complicated • …require iterative recomputations • …, if global, depend on the entire program Can a JIT compiler afford all or any of that? 67
  • 68. Dynamic Optimizations • Profiling and selective compilation • Inline substitution based on execution profile • Hot execution traces optimization • Optimal instruction selection 68
  • 69. Hot Code vs Warm Code Q: What happens when an app with no distinctly hot code runs on a typical JVM? A: Long warmup with results not stored for future reuse Typical case: UI-centric applications 69
  • 70. JFCMark (Short Run) 0% 50% 100% 150% 200% 250% 2 core Celeron, 2.60Ghz 4 core i5, 3.8GZ Excelsior JET HotSpot client HotSpot server Bigger – better 70
  • 71. JFCMark (Long Run) 0% 20% 40% 60% 80% 100% 120% 140% 160% 2 core Celeron, 2.60Ghz 4 core i5, 3.8GZ Excelsior JET HotSpot client HotSpot server 71 Bigger – better
  • 72. Profile Guided Optimizations Can a static compiler use dynamic execution profiles as input? 72
  • 73. Server side • CPU time in the cloud costs money • After some time, execution profile of a server app stabilizes • Why not pass it over to the AOT compiler? 73
  • 74. AOT on the Server side • Stable performance and predictable latency – no code de-optimizations occur at run-time • Work at full speed right from the start – good for load balancing • Better startup time – good when many servers start simultaneously • Still protects the code from decompilation 74
  • 75. Embedded/IoT • The less powerful the hardware, the more expensive dynamic compilation becomes • Embedded systems typically have less computing power than desktops and servers 75
  • 76. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler What is missing? 76
  • 77. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler What is missing? 77
  • 78. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler What is missing? 78
  • 79. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler What is missing? 79
  • 80. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler What is missing? 80
  • 81. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler What is missing? 81
  • 82. Mobile • JVM on Mobile: – Platform classes – Memory Manager and GC – Reflection – JIT Compiler Charger! 82
  • 83. Mobile • Wireless devices have batteries • Does it make sense to spend power on dynamic compilation? 83
  • 84. iOS • iOS policy prohibits creation of any native code during application run time • Getting Java apps to work on iOS requires either an interpreting JVM or an AOT compiler 84
  • 85. AOT Java Compilers in 2000 Desktop/Server: BulletTrain Excelsior JET GNU Compiler for Java (GCJ) IBM VisualAge for Java Supercede/JOVE TowerJ Embedded/Mobile: Diab FastJ Esmertec Jbed ME GCJ IBM J9 Sun Java ME (custom offerings) 85
  • 86. AOT Java Compilers in 2016 Desktop/Server: Excelsior JET GCJ IBM Java SDK for AIX IBM Java SDK for z/OS Embedded: Excelsior JET Embedded IBM WebSphere Real Time Oracle Java ME Embedded Client Codename One Avian Android ART RoboVM (RIP) Migeran (acquired by Intel) 86
  • 87. 87
  • 88. Static compilation of Java apps: 88
  • 89. Static compilation of Java apps: 89 Possible
  • 90. Static compilation of Java apps: 90 Possible Preserving all Java features
  • 91. Static compilation of Java apps: 91 Possible Preserving all Java features Useful in many aspects
  • 92. Q & A Nikita Lipsky, Excelsior nlipsky@excelsior-usa.com twitter: @pjBooms 92