SlideShare a Scribd company logo
1
JIT-compiler in JVM
seen by a Java developer
Vladimir Ivanov
HotSpot JVM Compiler
Oracle Corp.
2
Agenda
§  about compilers in general
–  … and JIT-compilers in particular
§  about JIT-compilers in HotSpot JVM
§  monitoring JIT-compilers in HotSpot JVM
3
Static vs Dynamic
AOT vs JIT
4
Dynamic and Static Compilation Differences
§  Static compilation
–  “ahead-of-time”(AOT) compilation
–  Source code → Native executable
–  Most of compilation work happens before executing
§  Modern Java VMs use dynamic compilers (JIT)
–  “just-in-time” (JIT) compilation
–  Source code → Bytecode → Interpreter + JITted executable
–  Most of compilation work happens during executing

Recommended for you

Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes

Java on Kubernetes may seem complicated, but after a bit of YAML and Dockerfiles, you will wonder what all that fuss was. But then the performance of your app in 1 CPU/1 GB of RAM makes you wonder. Learn how JVM ergonomics, CPU throttling, and GCs can help increase performance while reducing costs.

javajvmopenjdk
Experience with jemalloc
Experience with jemallocExperience with jemalloc
Experience with jemalloc

Jemalloc can help debug memory leaks in ATS plugins. It provides memory profiling by sampling memory allocations and dumping profiles to files. These profiles can then be viewed as gifs to analyze the call graph. The author provides two case studies where jemalloc helped identify leaks - a leak over months in ATS fronting APIs, and a 12 hour leak from a bug in their Brotli plugin. Jemalloc also improved ATS scalability by addressing issues with memory operations and plugins stressing the CPU to higher utilization.

オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)

オレ流のOpenJDKの開発環境 (JJUG CCC 2019 Fall講演資料、2019年11月23日) NTTデータ 技術開発本部 先進基盤技術グループ 末永 恭正 / Yasumasa Suenaga

openjdkjavanttデータ
5
Dynamic and Static Compilation Differences
§  Static compilation (AOT)
–  can utilize complex and heavy analyses and optimizations
–  … but static information sometimes isn’t enough
–  … and it’s hard to rely on profiling info, if any
–  moreover, how to utilize specific platform features (like SSE 4.2)?
6
Dynamic and Static Compilation Differences
§  Modern Java VMs use dynamic compilers (JIT)
–  aggressive optimistic optimizations
§  through extensive usage of profiling info
–  … but budget is limited and shared with an application
–  startup speed suffers
–  peak performance may suffer as well (not necessary)
7
JIT-compilation
§  Just-In-Time compilation
§  Compiled when needed
§  Maybe immediately before execution
–  ...or when we decide it’s important
–  ...or never?
8
Dynamic Compilation
in JVM

Recommended for you

Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time

This document discusses making Linux capable of hard real-time performance. It begins by defining hard and soft real-time systems and explaining that real-time does not necessarily mean fast but rather determinism. It then covers general concepts around real-time performance in Linux like preemption, interrupts, context switching, and scheduling. Specific features in Linux like RT-Preempt, priority inheritance, and threaded interrupts that improve real-time capabilities are also summarized.

Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB

GDB can debug programs by running them under its control. It allows inspecting and modifying program state through breakpoints, watchpoints, and examining variables and memory. GDB supports debugging optimized code, multi-threaded programs, and performing tasks like stepping, continuing, and backtracing through the call stack. It can also automate debugging through commands, scripts, and breakpoint actions.

q22012ulrich weigand
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...

Learn what you need to know to experience nirvana in the evaluation of G1 GC even if your are migrating from Parallel GC to G1, or CMS GC to G1 GC You also get a walk through of some case study data G1 GC

javaone 2013g1 gc
9
JVM
§  Runtime
–  class loading, bytecode verification, synchronization
§  JIT
–  profiling, compilation plans, OSR
–  aggressive optimizations
§  GC
–  different algorithms: throughput vs. response time
10
JVM: Makes Bytecodes Fast
§  JVMs eventually JIT bytecodes
–  To make them fast
–  Some JITs are high quality optimizing compilers
§  But cannot use existing static compilers directly:
–  Tracking OOPs (ptrs) for GC
–  Java Memory Model (volatile reordering & fences)
–  New code patterns to optimize
–  Time & resource constraints (CPU, memory)
11
JVM: Makes Bytecodes Fast
§  JIT'ing requires Profiling
–  Because you don't want to JIT everything
§  Profiling allows focused code-gen
§  Profiling allows better code-gen
–  Inline what’s hot
–  Loop unrolling, range-check elimination, etc
–  Branch prediction, spill-code-gen, scheduling
12
Dynamic Compilation (JIT)
§  Knows about
–  loaded classes, methods the program has executed
§  Makes optimization decisions based on code paths executed
–  Code generation depends on what is observed:
§  loaded classes, code paths executed, branches taken
§  May re-optimize if assumption was wrong, or alternative code paths
taken
–  Instruction path length may change between invocations of methods as a
result of de-optimization / re-compilation

Recommended for you

Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6

* 2015/12/01 12:40 修正 * P.65 の1段落目の表現を修正しました。(不要オブジェクトが閾値を上回る -> 生存オブジェクトが閾値を下回る) 表現だけ見ると内容は一緒なのですが、オプションで指定可能な閾値の意味を考慮すると修正前の文章は誤りでした。 Introduction of G1 GC at JJUG CCC 2015 Fall. http://www.java-users.jp/?page_id=2056

jvmg1 gcgc
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs

This document discusses using Linux perf_events (perf) profiling tools to analyze Java performance on Linux. It describes how perf can provide complete visibility into Java, JVM, GC and system code but that Java profilers have limitations. It presents the solution of using perf to collect mixed-mode flame graphs that include Java method names and symbols. It also discusses fixing issues with broken Java stacks and missing symbols on x86 architectures in perf profiles.

javaperformance
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016

Broken benchmarks, misleading metrics, and terrible tools. This talk will help you navigate the treacherous waters of Linux performance tools, touring common problems with system tools, metrics, statistics, visualizations, measurement overhead, and benchmarks. You might discover that tools you have been using for years, are in fact, misleading, dangerous, or broken. The speaker, Brendan Gregg, has given many talks on tools that work, including giving the Linux PerformanceTools talk originally at SCALE. This is an anti-version of that talk, to focus on broken tools and metrics instead of the working ones. Metrics can be misleading, and counters can be counter-intuitive! This talk will include advice for verifying new performance tools, understanding how they work, and using them successfully.

13
Dynamic Compilation (JIT)
§  Can do non-conservative optimizations in dynamic
§  Separates optimization from product delivery cycle
–  Update JVM, run the same application, realize improved performance!
–  Can be "tuned" to the target platform
14
Profiling
§  Gathers data about code during execution
–  invariants
§  types, constants (e.g. null pointers)
–  statistics
§  branches, calls
§  Gathered data is used during optimization
–  Educated guess
–  Guess can be wrong
15
Profile-guided optimization (PGO)
§  Use profile for more efficient optimization
§  PGO in JVMs
–  Always have it, turned on by default
–  Developers (usually) not interested or concerned about it
–  Profile is always consistent to execution scenario
16
Optimistic Compilers
§  Assume profile is accurate
–  Aggressively optimize based on profile
–  Bail out if we’re wrong
§  ...and hope that we’re usually right

Recommended for you

Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools

Video: https://www.youtube.com/watch?v=FJW8nGV4jxY and https://www.youtube.com/watch?v=zrr2nUln9Kk . Tutorial slides for O'Reilly Velocity SC 2015, by Brendan Gregg. There are many performance tools nowadays for Linux, but how do they all fit together, and when do we use them? This tutorial explains methodologies for using these tools, and provides a tour of four tool types: observability, benchmarking, tuning, and static tuning. Many tools will be discussed, including top, iostat, tcpdump, sar, perf_events, ftrace, SystemTap, sysdig, and others, as well observability frameworks in the Linux kernel: PMCs, tracepoints, kprobes, and uprobes. This tutorial is updated and extended on an earlier talk that summarizes the Linux performance tool landscape. The value of this tutorial is not just learning that these tools exist and what they do, but hearing when and how they are used by a performance engineer to solve real world problems — important context that is typically not included in the standard documentation.

linux performance tools tracing
使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder

JDK Flight Recorder introduced in OpenJDK 11. This feature is low overhead of profiling and be able to used on production environment. High Performance recording engine is embedded to Hotspot VM.

custom eventjavaopenjdk 11
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道

Linux uses /proc/iomem as a "Rosetta Stone" to establish relationships between software and hardware. /proc/iomem maps physical memory addresses to devices, similar to how the Rosetta Stone helped map Egyptian hieroglyphs to Greek and decode ancient Egyptian texts. This virtual file allows the kernel to interface with devices by providing address translations between physical and virtual memory spaces.

kerneldevicelinux
17
Dynamic Compilation (JIT)
§  Is dynamic compilation overhead essential?
–  The longer your application runs, the less the overhead
§  Trading off compilation time, not application time
–  Steal some cycles very early in execution
–  Done automagically and transparently to application
§  Most of “perceived” overhead is compiler waiting for more data
–  ...thus running semi-optimal code for time being
Overhead
18
JVM
Author: Alexey Shipilev
19
Mixed-Mode Execution
§  Interpreted
–  Bytecode-walking
–  Artificial stack machine
§  Compiled
–  Direct native operations
–  Native register machine
20
Bytecode Execution
1 2
34
Interpretation Profiling
Dynamic
Compilation
Deoptimization

Recommended for you

A whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizerA whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizer

A high level overview of the LLVM middle-end optimization pipeline, as well as the most important optimization passes.

llvmoptimization
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?

It is the presentation file used by Jim Huang (jserv) at OSDC.tw 2009. New compiler technologies are invisible but highly integrated around our world, and we can enrich the experience via facilitating LLVM.

0xlabosdctw2009compiler
Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Linuxのプロセススケジューラ(Reading the Linux process scheduler)Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Linuxのプロセススケジューラ(Reading the Linux process scheduler)

NLKB-005

schedulerlinuxkernel
21
Deoptimization
§  Bail out of running native code
–  stop executing native (JIT-generated) code
–  start interpreting bytecode
§  It’s a complicated operation at runtime…
22
OSR: On-Stack Replacement
§  Running method never exits?
§  But it’s getting really hot?
§  Generally means loops, back-branching
§  Compile and replace while running
§  Not typically useful in large systems
§  Looks great on benchmarks!
23
Optimizations
24
Optimizations in HotSpot JVM
§  compiler tactics
delayed compilation
tiered compilation
on-stack replacement
delayed reoptimization
program dependence graph rep.
static single assignment rep.
§  proof-based techniques
exact type inference
memory value inference
memory value tracking
constant folding
reassociation
operator strength reduction
null check elimination
type test strength reduction
type test elimination
algebraic simplification
common subexpression elimination
integer range typing
§  flow-sensitive rewrites
conditional constant propagation
dominating test detection
flow-carried type narrowing
dead code elimination
§  language-specific techniques
class hierarchy analysis
devirtualization
symbolic constant propagation
autobox elimination
escape analysis
lock elision
lock fusion
de-reflection
§  speculative (profile-based) techniques
optimistic nullness assertions
optimistic type assertions
optimistic type strengthening
optimistic array length strengthening
untaken branch pruning
optimistic N-morphic inlining
branch frequency prediction
call frequency prediction
§  memory and placement transformation
expression hoisting
expression sinking
redundant store elimination
adjacent store fusion
card-mark elimination
merge-point splitting
§  loop transformations
loop unrolling
loop peeling
safepoint elimination
iteration range splitting
range check elimination
loop vectorization
§  global code shaping
inlining (graph integration)
global code motion
heat-based code layout
switch balancing
throw inlining
§  control flow graph transformation
local code scheduling
local code bundling
delay slot filling
graph-coloring register allocation
linear scan register allocation
live range splitting
copy coalescing
constant splitting
copy removal
address mode matching
instruction peepholing
DFA-based code generator

Recommended for you

java.lang.OutOfMemoryError #渋谷java
java.lang.OutOfMemoryError #渋谷javajava.lang.OutOfMemoryError #渋谷java
java.lang.OutOfMemoryError #渋谷java

#渋谷java 発表資料です。

java
Javaトラブルに備えよう #jjug_ccc #ccc_h2
Javaトラブルに備えよう #jjug_ccc #ccc_h2Javaトラブルに備えよう #jjug_ccc #ccc_h2
Javaトラブルに備えよう #jjug_ccc #ccc_h2

JJUG CCC 2014 Spring #ccc_h2 のスライドです

just in time JIT compiler
just in time JIT compilerjust in time JIT compiler
just in time JIT compiler

This document is a term paper on Just-In-Time compilers (JIT). It begins with an acknowledgements section thanking the teacher for guidance. It then provides an introduction defining JIT as improving runtime performance of bytecode programs by compiling to machine code during execution. The paper discusses time-space tradeoffs of JIT and how JIT functions by compiling sections of bytecode to native code prior to execution. It also classifies JIT compilers based on invocation, executability, and concurrency. The conclusion restates that the paper provided an overview of JIT compilers.

25
JVM: Makes Virtual Calls Fast
§  C++ avoids virtual calls – because they are slow
§  Java embraces them – and makes them fast
–  Well, mostly fast – JIT's do Class Hierarchy Analysis (CHA)
–  CHA turns most virtual calls into static calls
–  JVM detects new classes loaded, adjusts CHA
§  May need to re-JIT
–  When CHA fails to make the call static, inline caches
–  When IC's fail, virtual calls are back to being slow
26
Call Site
§  The place where you make a call
§  Monomorphic (“one shape”)
–  Single target class
§  Bimorphic (“two shapes”)
§  Polymorphic (“many shapes”)
§  Megamorphic
27
Inlining
§  Combine caller and callee into one unit
–  e.g.based on profile
–  … or prove smth using CHA (Class Hierarchy Analysis)
–  Perhaps with a guard/test
§  Optimize as a whole
–  More code means better visibility
28
Inlining
int addAll(int max) {
int accum = 0;
for (int i = 0; i < max; i++) {
accum = add(accum, i);
}
return accum;
}
int add(int a, int b) { return a + b; }

Recommended for you

"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

This document provides an overview of JVM JIT compilers, specifically focusing on the HotSpot JVM compiler. It discusses the differences between static and dynamic compilation, how just-in-time compilation works in the JVM, profiling and optimizations performed by JIT compilers like inlining and devirtualization, and how to monitor the JIT compiler through options like -XX:+PrintCompilation and -XX:+PrintInlining.

#jvm #hotspot #jit
Jit complier
Jit complierJit complier
Jit complier

This document discusses Java compilers and their impact on performance. It explains that Java uses a two-step compilation process to achieve both portability and speed. The first step compiles Java code to bytecode, while the second step just-in-time compiles the bytecode to native machine code. It describes how client-side compilers focus on fast startup times while server-side compilers emphasize long-term optimizations. Tiered compilation combines aspects of both. The document also introduces hotspot compilation, which optimizes frequently executed code sections.

Presto@Uber
Presto@UberPresto@Uber
Presto@Uber

Presto is Uber's distributed SQL query engine for their Hadoop data warehouse. Some key points: - Presto allows interactive SQL queries directly on Uber's petabyte-scale Hadoop data lake without needing to first load the data into another database. - It provides fast performance at scale by leveraging columnar data formats like Parquet and optimizing for distributed execution across many nodes. - Uber deployed a 200 node Presto cluster that handles 30,000 queries per day, serving both ad hoc queries and real-time applications accessing data in Hadoop and improving on the performance of alternative solutions like Hive.

29
Inlining
int addAll(int max) {
int accum = 0;
for (int i = 0; i < max; i++) {
accum = accum + i;
}
return accum;
}
30
Inlining and devirtualization
§  Inlining is the most profitable compiler optimization
–  Rather straightforward to implement
–  Huge benefits: expands the scope for other optimizations
§  OOP needs polymorphism, that implies virtual calls
–  Prevents naïve inlining
–  Devirtualization is required
–  (This does not mean you should not write OOP code)
31
JVM Devirtualization
§  Developers shouldn't care
§  Analyze hierarchy of currently loaded classes
§  Efficiently devirtualize all monomorphic calls
§  Able to devirtualize polymorphic calls
§  JVM may inline dynamic methods
–  Reflection calls
–  Runtime-synthesized methods
–  JSR 292
32
Feedback multiplies optimizations
§  On-line profiling and CHA produces information
–  ...which lets the JIT ignore unused paths
–  ...and helps the JIT sharpen types on hot paths
–  ...which allows calls to be devirtualized
–  ...allowing them to be inlined
–  ...expanding an ever-widening optimization horizon
§  Result:
Large native methods containing tightly optimized machine code for
hundreds of inlined calls!

Recommended for you

JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)

Обеспечение достойной производительности высокоуровневого языка с динамической типизацией - непростая задача. Just-in-time (JIT) компиляция - динамическая генерация машинного кода с учетом информации, собранной во время выполнения приложения - ключевой элемент производительности виртуальной машины (будь то Java, .NET или даже JavaScript). JIT-компилятор, в свою очередь, должен иметь впечатляющий набор трюков и оптимизаций, что бы компенсировать "динамизм" языка. В докладе речь пойдет о достижениях современной JIT компиляции в целом и более подробно будут освещены особенности HotSpot JVM (бесплатной JVM от Oracle)

jitjava virtual machinejust in time compilation
Владимир Иванов. JIT для Java разработчиков
Владимир Иванов. JIT для Java разработчиковВладимир Иванов. JIT для Java разработчиков
Владимир Иванов. JIT для Java разработчиков

This document provides an overview of just-in-time (JIT) compilers in the HotSpot Java Virtual Machine (JVM). It discusses the differences between static and dynamic compilation, how modern JVMs use dynamic compilers and profiling data to perform aggressive optimizations, and some of the specific optimizations used in the HotSpot JVM like inlining, devirtualization, and on-stack replacement.

JIT Soultions: Overview
 JIT Soultions: Overview JIT Soultions: Overview
JIT Soultions: Overview

This document summarizes the services and operations of a software development company with offices in Gdynia and Warsaw, Poland. The company has grown from 8 to 96 employees in 2 years. They offer dedicated software solutions, IT outsourcing, expert services, and software products. Their main technical skills include Java, JavaScript, PL/SQL, Android, C#, and C++ development. They emphasize quality assurance through practices like agile development, test automation, and transparency. The company recruits candidates through various sources and has deep engagement with the academic community through student projects, internships, and university partnerships.

outsourceitjit
33
Loop unrolling
public void foo(int[] arr, int a) {
for (int i = 0; i < arr.length; i++) {
arr[i] += a;
}
}
34
Loop unrolling
public void foo(int[] arr, int a) {
for (int i = 0; i < arr.length; i=i+4) {
arr[i] += a; arr[i+1] += a; arr[i+2] += a; arr[i+3] += a;
}
}
35
Loop unrolling
public void foo(int[] arr, int a) {
int new_limit = arr.length / 4;
for (int i = 0; i < new_limit; i++) {
arr[4*i] += a; arr[4*i+1] += a; arr[4*i+2] += a; arr[4*i+3] += a;
}
for (int i = new_limit*4; i < arr.length; i++) {
arr[i] += a;
}}
36
Lock Coarsening
pubic void m1(Object newValue) {
syncronized(this) {
field1 = newValue;
}
syncronized(this) {
field2 = newValue;
}
}

Recommended for you

Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GC

The document discusses tuning garbage collection in the Java Virtual Machine. It provides recommendations for sizing generations based on an application's object longevity and size to reduce premature promotions which are a major cause of garbage collection pauses. Maintaining a low allocation rate and promotion rate can also help reduce garbage collection frequency. Plotting metrics like allocation rates, promotion rates, and heap occupancy over time can help analyze garbage collection performance.

java vm runtimethroughput gccms gc
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...

This document provides an overview of garbage collection in the Java Virtual Machine. It discusses key concepts like generational collection, parallel and concurrent marking, and tuning garbage collection for throughput versus latency. Specific collectors like Parallel GC, CMS GC, and G1 GC are explained in terms of their marking and compaction algorithms. Memory tuning recommendations and analyzing garbage collection logs and heap dumps are also covered. The document concludes with a high-level explanation of the Garbage First garbage collector and how it uses region-based heap management.

parallel gcopenjdk gcs.java
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT Compiler

JavaOne 2016 presentation slides on the Testarossa Just In Time compiler technology from the IBM J9 Java Virtual Machine, which IBM is contributing to open source (800KLOC to date on github at the Eclipse OMR project). This talk covers both the overall structure of the compiler and provides some details on the dynamic AOT technology available in Testarossa since 2006.

not compilerjavaopen source
37
Lock Coarsening
pubic void m1(Object newValue) {
syncronized(this) {
field1 = newValue;
field2 = newValue;
}
}
38
Lock Eliding
public void m1() {
List list = new ArrayList();
synchronized (list) {
list.add(someMethod());
}
}
39
Lock Eliding
public void m1() {
List list = new ArrayList();
synchronized (list) {
list.add(someMethod());
}
}
40
Lock Eliding
public void m1() {
List list = new ArrayList();
list.add(someMethod());
}

Recommended for you

JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performance

At JavaOne keynote this year, Mark Reinhold talked about how Java 9 was much bigger than Jigsaw. To put that in numbers - 80+ JEPs bigger! Yes, we see more presentations on Jigsaw since it brings about modularity to the once monolithic JDK. But what about those other JEPs?! One of those "other" JEPs, is JEP 143 - 'Improve Contended Locking'. Monica will apply her performance engineering approach and talk about JEP 143 and Oracle's Studio Analyzer Performance Tool. The crux of the presentation will entail comparing performance of contended locks in JDK 9 to JDK 8.

java performancejdk 9java vm
Java Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideJava Performance Engineer's Survival Guide
Java Performance Engineer's Survival Guide

Managed runtime performance expert, Monica Beckwith will divulge her survival guide which is essential for any application performance engineer. Following simple rules and performance engineering patterns will make you and your stakeholders happy.

java performancejavajava application stack
Build Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVMBuild Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVM

The document discusses LLVM and its use in building programming language compilers and runtimes. It provides an overview of LLVM, including its core components like its intermediate representation (IR), optimizations, and code generation capabilities. It also discusses how LLVM is used in various applications like Android, browsers, and graphics processing. Examples are given of using Clang and LLVM to compile and run a simple C program.

compilerandroidosdctw2011
41
Escape Analysis
public int m1() {
Pair p = new Pair(1, 2);
return m2(p);
}
public int m2(Pair p) {
return p.first + m3(p);
}
public int m3(Pair p) { return p.second;}
Initial version
42
Escape Analysis
public int m1() {
Pair p = new Pair(1, 2);
return p.first + p.second;
}
After deep inlining
43
Escape Analysis
public int m1() {
return 3;
}
Optimized version
44
Intrinsic
§  Known to the JIT compiler
–  method bytecode is ignored
–  inserts “best” native code
§  e.g. optimized sqrt in machine code
§  Existing intrinsics
–  String::equals, Math::*, System::arraycopy, Object::hashCode,
Object::getClass, sun.misc.Unsafe::*

Recommended for you

Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript Engine

The document provides an overview of implementing a high-performance JavaScript engine. It discusses the key components including the parser, runtime, execution engine, garbage collector, and foreign function interface. It also covers various implementation strategies and tradeoffs for aspects like value representation, object models, execution engines, and garbage collection. The document emphasizes learning from Self VM and using techniques like hidden classes, inline caching, and tiered compilation and optimization.

selfjavascript enginejavascript
淺談編譯器最佳化技術
淺談編譯器最佳化技術淺談編譯器最佳化技術
淺談編譯器最佳化技術

大部分人對於編譯器印象停留在課堂上所教導的語法分析的理論以及實作, 而讓許多人對於編譯器技術相當怯步, 但在整個編譯過程中語法分析只是個開端, 但其實編譯器技術最有趣的部份在於中後端的最佳化技術, 其神秘的技術可讓程式加速許多, 在這次的分享中主要會介紹一些編譯器的基礎最佳化, 例如 Propagation, Dead Code Elimination, Inline, Common Subexpression Elimination 及 Loop Unrolling 等, 並透過 llvm 的一些小工具來輔助觀察這些最佳化的結果, 以此作為入門磚來了解編譯器如何運作。

compilerllvmgcc
Jit
JitJit
Jit

This document provides an overview of just-in-time (JIT) and lean operations. It defines JIT and discusses its goals of eliminating waste and achieving smooth, rapid material flow. Key aspects covered include JIT building blocks like product design, process design and personnel elements. Benefits include reduced inventory, flexibility and increased productivity. The document also compares JIT to traditional systems and outlines steps to transition to JIT.

45
HotSpot JVM
46
JVMs
§  Oracle HotSpot
§  IBM J9
§  Oracle JRockit
§  Azul Zing
§  Excelsior JET
§  Jikes RVM
47
HotSpot JVM
§  client / C1
§  server / C2
§  tiered mode (C1 + C2)
JIT-compilers
48
HotSpot JVM
§  client / C1
–  $ java –client
§  only available in 32-bit VM
–  fast code generation of acceptable quality
–  basic optimizations
–  doesn’t need profile
–  compilation threshold: 1,5k invocations
JIT-compilers

Recommended for you

from Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Worksfrom Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Works

GNU Toolchain is the de facto standard of IT industrial and has been improved by comprehensive open source contributions. In this session, it is expected to cover the mechanism of compiler driver, system interaction (take GNU/Linux for example), linker, C runtime library, and the related dynamic linker. Instead of analyzing the system design, the session is use case driven and illustrated progressively.

compilerassemblertoolchain
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!

In Java 9, Garbage First Garbage Collector (G1 GC) will be the default GC. This presentation makes an effort to help Hotspot VM users to understand the concept of G1 GC as well as provides some tuning advice.

java performancehotspotgarbage first garbage collector
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch

Introduce Brainf*ck, another Turing complete programming language. Then, try to implement the following from scratch: Interpreter, Compiler [x86_64 and ARM], and JIT Compiler.

brainfuckbrainfcompiler
49
HotSpot JVM
§  server / C2
–  $ java –server
–  highly optimized code for speed
–  many aggressive optimizations which rely on profile
–  compilation threshold: 10k invocations
JIT-compilers
50
HotSpot JVM
§  Client / C1
+ fast startup
–  peak performance suffers
§  Server / C2
+ very good code for hot methods
–  slow startup / warmup
JIT-compilers comparison
51
Tiered compilation
§  -XX:+TieredCompilation
§  Multiple tiers of interpretation, C1, and C2
§  Level0=Interpreter
§  Level1-3=C1
–  #1: C1 w/o profiling
–  #2: C1 w/ basic profiling
–  #3: C1 w/ full profiling
§  Level4=C2
C1 + C2
52
Monitoring JIT

Recommended for you

Just In Time (JIT) Systems
Just In Time (JIT) SystemsJust In Time (JIT) Systems
Just In Time (JIT) Systems

In this presentation we will discuss about the concept of just in time (JIT) production philosophy, types and concepts of JIT, objectives of JIT manufacturing, comparison between ideal production system and JIT production, characteristics of JIT system, JIT manufacturing vs. JIT purchasing. We will also discuss about major tools and techniques of JIT manufacturing, JIT implementation approach, problems regarding implementation of JIT, planning of a successful JIT system, obstacles faced for JIT conversion, operational benefits of JIT systems. To know more about Welingkar School’s Distance Learning Program and courses offered, visit: http://www.welingkaronline.org/distance-learning/online-mba.html

jit purchasingjit implementationlean production
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey Kovalenko

This document discusses Java Just-In-Time (JIT) compilation. It describes JIT as compiling Java bytecode to native machine code during program execution rather than prior to execution. It outlines the main types of JIT compilers in HotSpot (client, server, tiered) and the key optimizations they perform like inlining, escape analysis, on-stack replacement, and tiered compilation. The document provides details on JIT tuning flags and how to get more profiling information from the JIT compiler logs. It emphasizes that letting the JIT do its work through warmup and avoiding microbenchmarks is important to achieving full performance.

techtalksitlohika
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.

Apache Spark has rocked the big data landscape, quickly becoming the largest open source big data community with over 750 contributors from more than 200 organizations. Spark's core tenants of speed, ease of use, and its unified programming model fit neatly with the high performance, scalable, and manageable characteristics of modern Java runtimes. In this talk we introduce the Spark programming model, and describe some unique Java runtime capabilities in the JIT, fast networking, serialization techniques, and GPU off-loading that deliver the ultimate big data platform for solving business problems. We will show how solutions, previously infeasible with regular Java programming, become possible with a high performance Spark core runtime, enabling you to solve problems smarter and faster.

big datapresentation
53
Monitoring JIT-Compiler
§  how to print info about compiled methods?
–  -XX:+PrintCompilation
§  how to print info about inlining decisions
–  -XX:+PrintInlining
§  how to control compilation policy?
–  -XX:CompileCommand=…
§  how to print assembly code?
–  -XX:+PrintAssembly
–  -XX:+PrintOptoAssembly (C2-only)
54
Print Compilation
§  -XX:+PrintCompilation
§  Print methods as they are JIT-compiled
§  Class + name + size
55
Print Compilation
$ java -XX:+PrintCompilation
988 1 java.lang.String::hashCode (55 bytes)
1271 2 sun.nio.cs.UTF_8$Encoder::encode (361 bytes)
1406 3 java.lang.String::charAt (29 bytes)
Sample output
56
Print Compilation
§  2043 470 % ! jdk.nashorn.internal.ir.FunctionNode::accept @ 136 (265 bytes)
% == OSR compilation
! == has exception handles (may be expensive)
s == synchronized method
§  2028 466 n java.lang.Class::isArray (native)
n == native method
Other useful info

Recommended for you

Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016

Apache Spark has rocked the big data landscape, becoming the largest open source big data community with over 750 contributors from more than 200 organizations. Spark's core tenants of speed, ease of use, and its unified programming model fit neatly with the high performance, scalable, and manageable characteristics of modern Java runtimes. In this talk Tim Ellison, a JVM developer at IBM, shows some of the unique Java 8 capabilities in the JIT compiler, fast networking, serialization techniques, and GPU off-loading that deliver the ultimate big data platform for solving business problems. Tim will demonstrate how solutions, previously infeasible with regular Java programming, become possible with this high performance Spark core runtime, enabling you to solve problems smarter and faster.

javaperformanceapache spark
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance

This document discusses techniques for improving the performance of Apache Spark applications. It describes optimizing the Java virtual machine by enhancing the just-in-time compiler, improving the object serializer, enabling faster I/O using technologies like RDMA networking and CAPI flash storage, and offloading tasks to graphics processors. The document provides examples of code style guidelines and specific Spark optimizations that further improve performance, such as leveraging hardware accelerators and tuning JVM heuristics.

performancejavajvm
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster

The IBM JVM runs Apache Spark fast! This talk explains some of the findings and optimizations from our experience of running Spark workloads. The talk was originally presented at the SparkEU Summit 2015 in Amsterdam.

apache sparkibm javabig data
57
Print Compilation
§  621 160 java.lang.Object::equals (11 bytes) made not entrant
–  don‘t allow any new calls into this compiled version
§  1807 160 java.lang.Object::equals (11 bytes) made zombie
–  can safely throw away compiled version
Not just compilation notifications
58
No JIT At All?
§  Code is too large
§  Code isn’t too «hot»
–  executed not too often
59
Print Inlining
§  -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
§  Shows hierarchy of inlined methods
§  Prints reason, if a method isn’t inlined
60
Print Inlining
$ java -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
75 1 java.lang.String::hashCode (55 bytes)
88 2 sun.nio.cs.UTF_8$Encoder::encode (361 bytes)
@ 14 java.lang.Math::min (11 bytes) (intrinsic)
@ 139 java.lang.Character::isSurrogate (18 bytes) never executed
103 3 java.lang.String::charAt (29 bytes)

Recommended for you

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler

The document discusses the benefits of moving JIT compilation out of individual JVMs and into a shared, cloud-based compiler service. This "JIT-as-a-Service" approach improves efficiency by allowing optimization resources to be shared and elastic across JVMs. It also enables optimized code to be reused for applications that execute on multiple devices. Moving JIT compilation to the cloud reduces warmup time, memory footprint, and CPU usage for JVMs while improving the level of optimizations that can be performed.

jvmjavajdk
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

Code examples are available here: https://github.com/ivailo-pashov/jvmmagic How well do you know what is going inside the JVM? How about its secret backdoors and nasty hacks? Initially they appear as magic tricks but being aware what is going on behind the scenes will save your time when real issues arise.

#jvm #tricks #hacking
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala TaiwanScala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan

Scala Taiwan - https://gitter.im/ScalaTaiwan/ScalaTaiwan Scala Taiwan Meetup - https://www.meetup.com/Scala-Taiwan-Meetup/ * How to Performance tuning? * Scala Performance * Why Scala? * Spark(1.6) Scala Performance

jvmscalaperformance
61
Inlining Tuning
§  -XX:MaxInlineSize=35
–  Largest inlinable method (bytecode)
§  -XX:InlineSmallCode=#
–  Largest inlinable compiled method
§  -XX:FreqInlineSize=#
–  Largest frequently-called method…
§  -XX:MaxInlineLevel=9
–  How deep does the rabbit hole go?
§  -XX:MaxRecursiveInlineLevel=#
–  recursive inlining
62
Machine Code
§  -XX:+PrintAssembly
§  http://wikis.sun.com/display/HotSpotInternals/PrintAssembly
§  Knowing code compiles is good
§  Knowing code inlines is better
§  Seeing the actual assembly is best!
63
-XX:CompileCommand=
§  Syntax
–  “[command] [method] [signature]”
§  Supported commands
–  exclude – never compile
–  inline – always inline
–  dontinline – never inline
§  Method reference
–  class.name::methodName
§  Method signature is optional
64
What Have We Learned?
§  How JIT compilers work
§  How HotSpot’s JIT works
§  How to monitor the JIT in HotSpot

Recommended for you

New hope is comming? Project Loom.pdf
New hope is comming? Project Loom.pdfNew hope is comming? Project Loom.pdf
New hope is comming? Project Loom.pdf

At a time when Herbt Sutter announced to everyone that the free lunch is over (The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software), concurrency has become our everyday life.A big change is coming to Java, the Loom project and with it such new terms as "virtual thread", "continuations" and "structured concurrency". If you've been wondering what they will change in our daily work or whether it's worth rewriting your Tomcat-based application to super-efficient reactive Netty,or whether to wait for Project Loom? This presentation is for you. I will talk about the Loom project and the new possibilities related to virtual wattles and "structured concurrency". I will tell you how it works and what can be achieved and the impact on performance

project loomvirtual threadsjava
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning

The document discusses various topics related to tuning the Java Virtual Machine (JVM) for performance, including: 1. Hotspot compiler options like method inlining that can improve performance. 2. Threading models on Solaris like M:N and 1:1 and how tuning thread-related JVM options can significantly impact throughput. 3. Memory and garbage collection tuning like selecting the right GC algorithm, tuning heap sizes, and analyzing GC logs to identify bottlenecks and optimize full GC frequency and duration.

jvmtuningperformancejava
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning

JVM performance tuning guide. describes JVM memory structure and explains gc mechanism. and guide for tuning jvm.

jvmmemorytuningperformance
65
“Quantum Performance Effects”
Sergey Kuksenko, Oracle
today, 13:30-14:30, «San-Francisco» hall
“Bulletproof Java Concurrency”
Aleksey Shipilev, Oracle
today, 15:30-16:30, «Moscow» hall
Related Talks
66
Questions?
vladimir.x.ivanov@oracle.com
@iwanowww
67
Graphic Section Divider

More Related Content

What's hot

UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)
Kris Mok
 
Metaspace
MetaspaceMetaspace
Metaspace
Yasumasa Suenaga
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
Brendan Gregg
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
Bruno Borges
 
Experience with jemalloc
Experience with jemallocExperience with jemalloc
Experience with jemalloc
Kit Chan
 
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
NTT DATA Technology & Innovation
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
National Cheng Kung University
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
Linaro
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Monica Beckwith
 
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Yuji Kubota
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
Brendan Gregg
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016
Brendan Gregg
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
Brendan Gregg
 
使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder
Yoshiro Tokumasu
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
National Cheng Kung University
 
A whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizerA whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizer
Nikita Popov
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
National Cheng Kung University
 
Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Linuxのプロセススケジューラ(Reading the Linux process scheduler)Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Hiraku Toyooka
 
java.lang.OutOfMemoryError #渋谷java
java.lang.OutOfMemoryError #渋谷javajava.lang.OutOfMemoryError #渋谷java
java.lang.OutOfMemoryError #渋谷java
Yuji Kubota
 
Javaトラブルに備えよう #jjug_ccc #ccc_h2
Javaトラブルに備えよう #jjug_ccc #ccc_h2Javaトラブルに備えよう #jjug_ccc #ccc_h2
Javaトラブルに備えよう #jjug_ccc #ccc_h2
Norito Agetsuma
 

What's hot (20)

UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)UseNUMA做了什么?(2012-03-14)
UseNUMA做了什么?(2012-03-14)
 
Metaspace
MetaspaceMetaspace
Metaspace
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
Experience with jemalloc
Experience with jemallocExperience with jemalloc
Experience with jemalloc
 
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
オレ流のOpenJDKの開発環境(JJUG CCC 2019 Fall講演資料)
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
 
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
Garbage First Garbage Collection (G1 GC) #jjug_ccc #ccc_cd6
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
 
使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
A whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizerA whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizer
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 
Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Linuxのプロセススケジューラ(Reading the Linux process scheduler)Linuxのプロセススケジューラ(Reading the Linux process scheduler)
Linuxのプロセススケジューラ(Reading the Linux process scheduler)
 
java.lang.OutOfMemoryError #渋谷java
java.lang.OutOfMemoryError #渋谷javajava.lang.OutOfMemoryError #渋谷java
java.lang.OutOfMemoryError #渋谷java
 
Javaトラブルに備えよう #jjug_ccc #ccc_h2
Javaトラブルに備えよう #jjug_ccc #ccc_h2Javaトラブルに備えよう #jjug_ccc #ccc_h2
Javaトラブルに備えよう #jjug_ccc #ccc_h2
 

Viewers also liked

just in time JIT compiler
just in time JIT compilerjust in time JIT compiler
just in time JIT compiler
Mohit kumar
 
"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
Vladimir Ivanov
 
Jit complier
Jit complierJit complier
Jit complier
Kaya Ota
 
Presto@Uber
Presto@UberPresto@Uber
Presto@Uber
Zhenxiao Luo
 
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
aragozin
 
Владимир Иванов. JIT для Java разработчиков
Владимир Иванов. JIT для Java разработчиковВладимир Иванов. JIT для Java разработчиков
Владимир Иванов. JIT для Java разработчиков
Volha Banadyseva
 
JIT Soultions: Overview
 JIT Soultions: Overview JIT Soultions: Overview
JIT Soultions: Overview
JIT Solutions
 
Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GC
Monica Beckwith
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
Monica Beckwith
 
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT Compiler
Mark Stoodley
 
JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performance
Monica Beckwith
 
Java Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideJava Performance Engineer's Survival Guide
Java Performance Engineer's Survival Guide
Monica Beckwith
 
Build Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVMBuild Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVM
National Cheng Kung University
 
Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript Engine
Kris Mok
 
淺談編譯器最佳化技術
淺談編譯器最佳化技術淺談編譯器最佳化技術
淺談編譯器最佳化技術
Kito Cheng
 
Jit
JitJit
from Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Worksfrom Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Works
National Cheng Kung University
 
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
Monica Beckwith
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
National Cheng Kung University
 
Just In Time (JIT) Systems
Just In Time (JIT) SystemsJust In Time (JIT) Systems

Viewers also liked (20)

just in time JIT compiler
just in time JIT compilerjust in time JIT compiler
just in time JIT compiler
 
"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
 
Jit complier
Jit complierJit complier
Jit complier
 
Presto@Uber
Presto@UberPresto@Uber
Presto@Uber
 
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
JIT-компиляция в виртуальной машине Java (HighLoad++ 2013)
 
Владимир Иванов. JIT для Java разработчиков
Владимир Иванов. JIT для Java разработчиковВладимир Иванов. JIT для Java разработчиков
Владимир Иванов. JIT для Java разработчиков
 
JIT Soultions: Overview
 JIT Soultions: Overview JIT Soultions: Overview
JIT Soultions: Overview
 
Game of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GCGame of Performance: A Song of JIT and GC
Game of Performance: A Song of JIT and GC
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
 
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT Compiler
 
JFokus Java 9 contended locking performance
JFokus Java 9 contended locking performanceJFokus Java 9 contended locking performance
JFokus Java 9 contended locking performance
 
Java Performance Engineer's Survival Guide
Java Performance Engineer's Survival GuideJava Performance Engineer's Survival Guide
Java Performance Engineer's Survival Guide
 
Build Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVMBuild Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVM
 
Implementing a JavaScript Engine
Implementing a JavaScript EngineImplementing a JavaScript Engine
Implementing a JavaScript Engine
 
淺談編譯器最佳化技術
淺談編譯器最佳化技術淺談編譯器最佳化技術
淺談編譯器最佳化技術
 
Jit
JitJit
Jit
 
from Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Worksfrom Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Works
 
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
Just In Time (JIT) Systems
Just In Time (JIT) SystemsJust In Time (JIT) Systems
Just In Time (JIT) Systems
 

Similar to JVM JIT-compiler overview @ JavaOne Moscow 2013

Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey Kovalenko
Valeriia Maliarenko
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
J On The Beach
 
Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016
Tim Ellison
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
Tim Ellison
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
Tim Ellison
 
Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
Simon Ritter
 
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
Ivaylo Pashov
 
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala TaiwanScala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Jimin Hsieh
 
New hope is comming? Project Loom.pdf
New hope is comming? Project Loom.pdfNew hope is comming? Project Loom.pdf
New hope is comming? Project Loom.pdf
Krystian Zybała
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
guest1f2740
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
Terry Cho
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
Simon Ritter
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
Monica Beckwith
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
jClarity
 
Clr jvm implementation differences
Clr jvm implementation differencesClr jvm implementation differences
Clr jvm implementation differences
Jean-Philippe BEMPEL
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
InfinIT - Innovationsnetværket for it
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
Jim Driscoll
 
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
srisatish ambati
 
FOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMFOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VM
Charlie Gracie
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
Łukasz Koniecki
 

Similar to JVM JIT-compiler overview @ JavaOne Moscow 2013 (20)

Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey Kovalenko
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
 
Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
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
 
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala TaiwanScala & Spark(1.6) in Performance Aspect for Scala Taiwan
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
 
New hope is comming? Project Loom.pdf
New hope is comming? Project Loom.pdfNew hope is comming? Project Loom.pdf
New hope is comming? Project Loom.pdf
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
Clr jvm implementation differences
Clr jvm implementation differencesClr jvm implementation differences
Clr jvm implementation differences
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
 
FOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMFOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VM
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 

More from Vladimir Ivanov

"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia "What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
Vladimir Ivanov
 
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,..."Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
Vladimir Ivanov
 
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine "Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
Vladimir Ivanov
 
"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013
"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013
"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013
Vladimir Ivanov
 
"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012
"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012
"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012
Vladimir Ivanov
 
Управление памятью в Java: Footprint
Управление памятью в Java: FootprintУправление памятью в Java: Footprint
Управление памятью в Java: Footprint
Vladimir Ivanov
 
Многоуровневая компиляция в HotSpot JVM
Многоуровневая компиляция в HotSpot JVMМногоуровневая компиляция в HotSpot JVM
Многоуровневая компиляция в HotSpot JVM
Vladimir Ivanov
 
G1 GC: Garbage-First Garbage Collector
G1 GC: Garbage-First Garbage CollectorG1 GC: Garbage-First Garbage Collector
G1 GC: Garbage-First Garbage Collector
Vladimir Ivanov
 
"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)
"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)
"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)
Vladimir Ivanov
 

More from Vladimir Ivanov (9)

"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia "What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
"What's New in HotSpot JVM 8" @ JPoint 2014, Moscow, Russia
 
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,..."Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
 
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine "Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
"Optimizing Memory Footprint in Java" @ JEEConf 2013, Kiev, Ukraine
 
"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013
"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013
"Invokedynamic: роскошь или необходимость?"@ JavaOne Moscow 2013
 
"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012
"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012
"G1 GC и Обзор сборки мусора в HotSpot JVM" @ JUG SPb, 31-05-2012
 
Управление памятью в Java: Footprint
Управление памятью в Java: FootprintУправление памятью в Java: Footprint
Управление памятью в Java: Footprint
 
Многоуровневая компиляция в HotSpot JVM
Многоуровневая компиляция в HotSpot JVMМногоуровневая компиляция в HotSpot JVM
Многоуровневая компиляция в HotSpot JVM
 
G1 GC: Garbage-First Garbage Collector
G1 GC: Garbage-First Garbage CollectorG1 GC: Garbage-First Garbage Collector
G1 GC: Garbage-First Garbage Collector
 
"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)
"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)
"Диагностирование проблем и настройка GC в HotSpot JVM" (JEEConf, Киев, 2011)
 

Recently uploaded

Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 

Recently uploaded (20)

Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 

JVM JIT-compiler overview @ JavaOne Moscow 2013

  • 1. 1 JIT-compiler in JVM seen by a Java developer Vladimir Ivanov HotSpot JVM Compiler Oracle Corp.
  • 2. 2 Agenda §  about compilers in general –  … and JIT-compilers in particular §  about JIT-compilers in HotSpot JVM §  monitoring JIT-compilers in HotSpot JVM
  • 4. 4 Dynamic and Static Compilation Differences §  Static compilation –  “ahead-of-time”(AOT) compilation –  Source code → Native executable –  Most of compilation work happens before executing §  Modern Java VMs use dynamic compilers (JIT) –  “just-in-time” (JIT) compilation –  Source code → Bytecode → Interpreter + JITted executable –  Most of compilation work happens during executing
  • 5. 5 Dynamic and Static Compilation Differences §  Static compilation (AOT) –  can utilize complex and heavy analyses and optimizations –  … but static information sometimes isn’t enough –  … and it’s hard to rely on profiling info, if any –  moreover, how to utilize specific platform features (like SSE 4.2)?
  • 6. 6 Dynamic and Static Compilation Differences §  Modern Java VMs use dynamic compilers (JIT) –  aggressive optimistic optimizations §  through extensive usage of profiling info –  … but budget is limited and shared with an application –  startup speed suffers –  peak performance may suffer as well (not necessary)
  • 7. 7 JIT-compilation §  Just-In-Time compilation §  Compiled when needed §  Maybe immediately before execution –  ...or when we decide it’s important –  ...or never?
  • 9. 9 JVM §  Runtime –  class loading, bytecode verification, synchronization §  JIT –  profiling, compilation plans, OSR –  aggressive optimizations §  GC –  different algorithms: throughput vs. response time
  • 10. 10 JVM: Makes Bytecodes Fast §  JVMs eventually JIT bytecodes –  To make them fast –  Some JITs are high quality optimizing compilers §  But cannot use existing static compilers directly: –  Tracking OOPs (ptrs) for GC –  Java Memory Model (volatile reordering & fences) –  New code patterns to optimize –  Time & resource constraints (CPU, memory)
  • 11. 11 JVM: Makes Bytecodes Fast §  JIT'ing requires Profiling –  Because you don't want to JIT everything §  Profiling allows focused code-gen §  Profiling allows better code-gen –  Inline what’s hot –  Loop unrolling, range-check elimination, etc –  Branch prediction, spill-code-gen, scheduling
  • 12. 12 Dynamic Compilation (JIT) §  Knows about –  loaded classes, methods the program has executed §  Makes optimization decisions based on code paths executed –  Code generation depends on what is observed: §  loaded classes, code paths executed, branches taken §  May re-optimize if assumption was wrong, or alternative code paths taken –  Instruction path length may change between invocations of methods as a result of de-optimization / re-compilation
  • 13. 13 Dynamic Compilation (JIT) §  Can do non-conservative optimizations in dynamic §  Separates optimization from product delivery cycle –  Update JVM, run the same application, realize improved performance! –  Can be "tuned" to the target platform
  • 14. 14 Profiling §  Gathers data about code during execution –  invariants §  types, constants (e.g. null pointers) –  statistics §  branches, calls §  Gathered data is used during optimization –  Educated guess –  Guess can be wrong
  • 15. 15 Profile-guided optimization (PGO) §  Use profile for more efficient optimization §  PGO in JVMs –  Always have it, turned on by default –  Developers (usually) not interested or concerned about it –  Profile is always consistent to execution scenario
  • 16. 16 Optimistic Compilers §  Assume profile is accurate –  Aggressively optimize based on profile –  Bail out if we’re wrong §  ...and hope that we’re usually right
  • 17. 17 Dynamic Compilation (JIT) §  Is dynamic compilation overhead essential? –  The longer your application runs, the less the overhead §  Trading off compilation time, not application time –  Steal some cycles very early in execution –  Done automagically and transparently to application §  Most of “perceived” overhead is compiler waiting for more data –  ...thus running semi-optimal code for time being Overhead
  • 19. 19 Mixed-Mode Execution §  Interpreted –  Bytecode-walking –  Artificial stack machine §  Compiled –  Direct native operations –  Native register machine
  • 20. 20 Bytecode Execution 1 2 34 Interpretation Profiling Dynamic Compilation Deoptimization
  • 21. 21 Deoptimization §  Bail out of running native code –  stop executing native (JIT-generated) code –  start interpreting bytecode §  It’s a complicated operation at runtime…
  • 22. 22 OSR: On-Stack Replacement §  Running method never exits? §  But it’s getting really hot? §  Generally means loops, back-branching §  Compile and replace while running §  Not typically useful in large systems §  Looks great on benchmarks!
  • 24. 24 Optimizations in HotSpot JVM §  compiler tactics delayed compilation tiered compilation on-stack replacement delayed reoptimization program dependence graph rep. static single assignment rep. §  proof-based techniques exact type inference memory value inference memory value tracking constant folding reassociation operator strength reduction null check elimination type test strength reduction type test elimination algebraic simplification common subexpression elimination integer range typing §  flow-sensitive rewrites conditional constant propagation dominating test detection flow-carried type narrowing dead code elimination §  language-specific techniques class hierarchy analysis devirtualization symbolic constant propagation autobox elimination escape analysis lock elision lock fusion de-reflection §  speculative (profile-based) techniques optimistic nullness assertions optimistic type assertions optimistic type strengthening optimistic array length strengthening untaken branch pruning optimistic N-morphic inlining branch frequency prediction call frequency prediction §  memory and placement transformation expression hoisting expression sinking redundant store elimination adjacent store fusion card-mark elimination merge-point splitting §  loop transformations loop unrolling loop peeling safepoint elimination iteration range splitting range check elimination loop vectorization §  global code shaping inlining (graph integration) global code motion heat-based code layout switch balancing throw inlining §  control flow graph transformation local code scheduling local code bundling delay slot filling graph-coloring register allocation linear scan register allocation live range splitting copy coalescing constant splitting copy removal address mode matching instruction peepholing DFA-based code generator
  • 25. 25 JVM: Makes Virtual Calls Fast §  C++ avoids virtual calls – because they are slow §  Java embraces them – and makes them fast –  Well, mostly fast – JIT's do Class Hierarchy Analysis (CHA) –  CHA turns most virtual calls into static calls –  JVM detects new classes loaded, adjusts CHA §  May need to re-JIT –  When CHA fails to make the call static, inline caches –  When IC's fail, virtual calls are back to being slow
  • 26. 26 Call Site §  The place where you make a call §  Monomorphic (“one shape”) –  Single target class §  Bimorphic (“two shapes”) §  Polymorphic (“many shapes”) §  Megamorphic
  • 27. 27 Inlining §  Combine caller and callee into one unit –  e.g.based on profile –  … or prove smth using CHA (Class Hierarchy Analysis) –  Perhaps with a guard/test §  Optimize as a whole –  More code means better visibility
  • 28. 28 Inlining int addAll(int max) { int accum = 0; for (int i = 0; i < max; i++) { accum = add(accum, i); } return accum; } int add(int a, int b) { return a + b; }
  • 29. 29 Inlining int addAll(int max) { int accum = 0; for (int i = 0; i < max; i++) { accum = accum + i; } return accum; }
  • 30. 30 Inlining and devirtualization §  Inlining is the most profitable compiler optimization –  Rather straightforward to implement –  Huge benefits: expands the scope for other optimizations §  OOP needs polymorphism, that implies virtual calls –  Prevents naïve inlining –  Devirtualization is required –  (This does not mean you should not write OOP code)
  • 31. 31 JVM Devirtualization §  Developers shouldn't care §  Analyze hierarchy of currently loaded classes §  Efficiently devirtualize all monomorphic calls §  Able to devirtualize polymorphic calls §  JVM may inline dynamic methods –  Reflection calls –  Runtime-synthesized methods –  JSR 292
  • 32. 32 Feedback multiplies optimizations §  On-line profiling and CHA produces information –  ...which lets the JIT ignore unused paths –  ...and helps the JIT sharpen types on hot paths –  ...which allows calls to be devirtualized –  ...allowing them to be inlined –  ...expanding an ever-widening optimization horizon §  Result: Large native methods containing tightly optimized machine code for hundreds of inlined calls!
  • 33. 33 Loop unrolling public void foo(int[] arr, int a) { for (int i = 0; i < arr.length; i++) { arr[i] += a; } }
  • 34. 34 Loop unrolling public void foo(int[] arr, int a) { for (int i = 0; i < arr.length; i=i+4) { arr[i] += a; arr[i+1] += a; arr[i+2] += a; arr[i+3] += a; } }
  • 35. 35 Loop unrolling public void foo(int[] arr, int a) { int new_limit = arr.length / 4; for (int i = 0; i < new_limit; i++) { arr[4*i] += a; arr[4*i+1] += a; arr[4*i+2] += a; arr[4*i+3] += a; } for (int i = new_limit*4; i < arr.length; i++) { arr[i] += a; }}
  • 36. 36 Lock Coarsening pubic void m1(Object newValue) { syncronized(this) { field1 = newValue; } syncronized(this) { field2 = newValue; } }
  • 37. 37 Lock Coarsening pubic void m1(Object newValue) { syncronized(this) { field1 = newValue; field2 = newValue; } }
  • 38. 38 Lock Eliding public void m1() { List list = new ArrayList(); synchronized (list) { list.add(someMethod()); } }
  • 39. 39 Lock Eliding public void m1() { List list = new ArrayList(); synchronized (list) { list.add(someMethod()); } }
  • 40. 40 Lock Eliding public void m1() { List list = new ArrayList(); list.add(someMethod()); }
  • 41. 41 Escape Analysis public int m1() { Pair p = new Pair(1, 2); return m2(p); } public int m2(Pair p) { return p.first + m3(p); } public int m3(Pair p) { return p.second;} Initial version
  • 42. 42 Escape Analysis public int m1() { Pair p = new Pair(1, 2); return p.first + p.second; } After deep inlining
  • 43. 43 Escape Analysis public int m1() { return 3; } Optimized version
  • 44. 44 Intrinsic §  Known to the JIT compiler –  method bytecode is ignored –  inserts “best” native code §  e.g. optimized sqrt in machine code §  Existing intrinsics –  String::equals, Math::*, System::arraycopy, Object::hashCode, Object::getClass, sun.misc.Unsafe::*
  • 46. 46 JVMs §  Oracle HotSpot §  IBM J9 §  Oracle JRockit §  Azul Zing §  Excelsior JET §  Jikes RVM
  • 47. 47 HotSpot JVM §  client / C1 §  server / C2 §  tiered mode (C1 + C2) JIT-compilers
  • 48. 48 HotSpot JVM §  client / C1 –  $ java –client §  only available in 32-bit VM –  fast code generation of acceptable quality –  basic optimizations –  doesn’t need profile –  compilation threshold: 1,5k invocations JIT-compilers
  • 49. 49 HotSpot JVM §  server / C2 –  $ java –server –  highly optimized code for speed –  many aggressive optimizations which rely on profile –  compilation threshold: 10k invocations JIT-compilers
  • 50. 50 HotSpot JVM §  Client / C1 + fast startup –  peak performance suffers §  Server / C2 + very good code for hot methods –  slow startup / warmup JIT-compilers comparison
  • 51. 51 Tiered compilation §  -XX:+TieredCompilation §  Multiple tiers of interpretation, C1, and C2 §  Level0=Interpreter §  Level1-3=C1 –  #1: C1 w/o profiling –  #2: C1 w/ basic profiling –  #3: C1 w/ full profiling §  Level4=C2 C1 + C2
  • 53. 53 Monitoring JIT-Compiler §  how to print info about compiled methods? –  -XX:+PrintCompilation §  how to print info about inlining decisions –  -XX:+PrintInlining §  how to control compilation policy? –  -XX:CompileCommand=… §  how to print assembly code? –  -XX:+PrintAssembly –  -XX:+PrintOptoAssembly (C2-only)
  • 54. 54 Print Compilation §  -XX:+PrintCompilation §  Print methods as they are JIT-compiled §  Class + name + size
  • 55. 55 Print Compilation $ java -XX:+PrintCompilation 988 1 java.lang.String::hashCode (55 bytes) 1271 2 sun.nio.cs.UTF_8$Encoder::encode (361 bytes) 1406 3 java.lang.String::charAt (29 bytes) Sample output
  • 56. 56 Print Compilation §  2043 470 % ! jdk.nashorn.internal.ir.FunctionNode::accept @ 136 (265 bytes) % == OSR compilation ! == has exception handles (may be expensive) s == synchronized method §  2028 466 n java.lang.Class::isArray (native) n == native method Other useful info
  • 57. 57 Print Compilation §  621 160 java.lang.Object::equals (11 bytes) made not entrant –  don‘t allow any new calls into this compiled version §  1807 160 java.lang.Object::equals (11 bytes) made zombie –  can safely throw away compiled version Not just compilation notifications
  • 58. 58 No JIT At All? §  Code is too large §  Code isn’t too «hot» –  executed not too often
  • 59. 59 Print Inlining §  -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining §  Shows hierarchy of inlined methods §  Prints reason, if a method isn’t inlined
  • 60. 60 Print Inlining $ java -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining 75 1 java.lang.String::hashCode (55 bytes) 88 2 sun.nio.cs.UTF_8$Encoder::encode (361 bytes) @ 14 java.lang.Math::min (11 bytes) (intrinsic) @ 139 java.lang.Character::isSurrogate (18 bytes) never executed 103 3 java.lang.String::charAt (29 bytes)
  • 61. 61 Inlining Tuning §  -XX:MaxInlineSize=35 –  Largest inlinable method (bytecode) §  -XX:InlineSmallCode=# –  Largest inlinable compiled method §  -XX:FreqInlineSize=# –  Largest frequently-called method… §  -XX:MaxInlineLevel=9 –  How deep does the rabbit hole go? §  -XX:MaxRecursiveInlineLevel=# –  recursive inlining
  • 62. 62 Machine Code §  -XX:+PrintAssembly §  http://wikis.sun.com/display/HotSpotInternals/PrintAssembly §  Knowing code compiles is good §  Knowing code inlines is better §  Seeing the actual assembly is best!
  • 63. 63 -XX:CompileCommand= §  Syntax –  “[command] [method] [signature]” §  Supported commands –  exclude – never compile –  inline – always inline –  dontinline – never inline §  Method reference –  class.name::methodName §  Method signature is optional
  • 64. 64 What Have We Learned? §  How JIT compilers work §  How HotSpot’s JIT works §  How to monitor the JIT in HotSpot
  • 65. 65 “Quantum Performance Effects” Sergey Kuksenko, Oracle today, 13:30-14:30, «San-Francisco» hall “Bulletproof Java Concurrency” Aleksey Shipilev, Oracle today, 15:30-16:30, «Moscow» hall Related Talks