SlideShare uma empresa Scribd logo
1 de 74
Baixar para ler offline
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Ahead-of-Time Compilation with JDK 9
日本オラクル株式会社
Java SE Sustaining Engineering
バック デイビッド
Java Day Tokyo 2017
2017年5月17日
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
2
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
3
• JVM Sustaining Engineer
• OpenJDK 8 Update Project
Maintainer
• JavaOne Rock Star
• Co-author of Oracle WebLogic
Server 11g 構築・運用ガイド
• @DavidBuckJP
• https://blogs.oracle.com/buck/
Hi There!
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
4
Program Agenda
注意点
AoT のいろは
似ている機能
使い方
1
2
3
4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
5
注意点
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
6
要注意
• AoT は実験的なものであり、正式にはサポートされていない
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
7
要注意
• AoT は実験的なものであり、正式にはサポートされていない
• 現時点では、AMD64 の Linux しかサポートされていない
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
8
要注意
• AoT は実験的なものであり、正式にはサポートされていない
• 現時点では、AMD64 の Linux しかサポートされていない
• 正式なドキュメントはない(JEP のみ)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
9
要注意
• AoT は実験的なものであり、正式にはサポートされていない
• 現時点では、AMD64 の Linux しかサポートされていない
• 正式なドキュメントはない(JEP のみ)
• 現時点では、将来的にサポートされる予定はない
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
10
AoT のいろは
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
11
AoT を勉強する価値
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
12
AoT を勉強する価値
• 将来にサポートされるようになる可能性がある
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
13
AoT を勉強する価値
• 将来にサポートされるようになる可能性がある
• HotSpot の他の機能を勉強するきっかけである
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
14
AoT を勉強する価値
• 将来にサポートされるようになる可能性がある
• HotSpot の他の機能を勉強するきっかけである
• やはり、面白い!
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
15
Java Build / Execution Model (Interpreter)
MyClass.java MyClass.class java
(HotSpot)
javac
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
16
Java Build / Execution Model (JIT)
MyClass.java MyClass.class java
(HotSpot)
javac
マシン語
(メモリ上)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
17
Just in Time Compilation (JIT)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
18
Just in Time Compilation (JIT)
• メソッドがコンパイルされる
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
19
Just in Time Compilation (JIT)
• メソッドがコンパイルされる
• コンパイル処理は重い
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
20
Just in Time Compilation (JIT)
• メソッドがコンパイルされる
• コンパイル処理は重い
• マシン語のバージョンは早い
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
21
Just in Time Compilation (JIT)
• メソッドがコンパイルされる
• コンパイル処理は重い
• マシン語のバージョンは早い
• パフォーマンスは interpreter よりいい?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
22
Just in Time Compilation (JIT)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
23
Just in Time Compilation (JIT)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
24
Just in Time Compilation (JIT)
パフォーマンスは interpreter よりいい?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
25
Just in Time Compilation (JIT)
パフォーマンスは interpreter よりいい?
パフォーマンスの定義次第
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
26
$ time ./hello_jdt
Hello JavaDay Tokyo!
real 0m0.002s
user 0m0.001s
$ time java HelloJDT
Hello JavaDay Tokyo!
real 0m0.104s
user 0m0.077s
sys 0m0.020s
Just in Time Compilation (JIT)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
27
Just in Time Compilation (JIT)
弱点
• コンパイル処理が重い
– メソッドを実行出来るようになるまで時間かかる
– メモリの使用量が大きい
• Hot ではないメソッドの場合、interpreter のほうが適切
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
28
Just in Time Compilation (JIT)
(HotSpot の実装)
• まず、 すべてのメソッドは interpreter のみで実行
• サンプリングで Hot なメソッドを検出
• Hot のメソッドだけをコンパイル
• Hot ではないメソッドは interpreter で実行
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
29
HotSpot のJIT でも
• アプリの起動が時間がかかる
• 起動しても、最高のパフォーマンスまで時間がかかる
• コンパイル処理がメモリを消費する
• 実行時にマシン語を生成出来ないプラットフォームもある
ネイティブ(C/C++ などと比べると)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
30
Just in Time Compilation (JIT) (HotSpot の実装)
2コンパイラ物語
• C2
– Server 用
– 最適化を頑張る
– Interpreter が収集するプロファイリングデータを参考する
– デフォルト CompileThreshold : 10000
• C1
– Client 用
– 最適化はあまりしない
– プロファイリングデータをあまり利用しない
– デフォルト CompileThreshold : 1500
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
31
Ahead of Time (AoT) の戦略
• 実行の前にマシン語を生成しておく
• 実行時に既存のマシン語をロードして実行する
• 実行時にマシン語を生成する必要はなくなる
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
32
Java Build / Execution Model (AoT)
MyClass.java MyClass.class java
(HotSpot)
javac
マシン語
(メモリ上)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
33
Java Build / Execution Model (AoT)
MyClass.java MyClass.class java
(HotSpot)
javac
my_class.so
jaotc
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
34
Java Build / Execution Model
java
(HotSpot)
マシン語
(メモリ上)
java
(HotSpot)
マシン語
(メモリ上)
java
(HotSpot)
マシン語
(メモリ上)
java
(HotSpot)
マシン語
(メモリ上)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
35
Java Build / Execution Model
java
(HotSpot)
java
(HotSpot)
java
(HotSpot)
java
(HotSpot)
my_class.so
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
36
Ahead of Time (AoT) の戦略
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
37
Ahead of Time (AoT) の戦略
• アプリの起動が早くなる ★
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
38
Ahead of Time (AoT) の戦略
• アプリの起動が早くなる ★
• peak performance / steady state まですぐ達成する ★
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
39
Ahead of Time (AoT) の戦略
• アプリの起動が早くなる ★
• peak performance / steady state まですぐ達成する ★
• コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
40
Ahead of Time (AoT) の戦略
• アプリの起動が早くなる ★
• peak performance / steady state まですぐ達成する ★
• コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★
• 同じマシン語のデータを共有することが出来る ★
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
41
Ahead of Time (AoT) の戦略
• アプリの起動が早くなる ★
• peak performance / steady state まですぐ達成する ★
• コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★
• 同じマシン語のデータを共有することが出来る ★
• 実行時にマシン語を生成出来ないプラットフォームでも利用できる ★
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
42
Ahead of Time (AoT) の戦略
• アプリの起動が早くなる ★
• peak performance / steady state まですぐ達成する ★
• コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★
• 同じマシン語のデータを共有することが出来る ★
• 実行時にマシン語を生成出来ないプラットフォームでも利用できる ★
★ 場合がある
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
43
?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
44
似ている機能
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
45
少し似ている技術
• Tiered Compilation
• Class Data Sharing(CDS) / AppCDS
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
46
Tiered Compilation
• 従来の server JVM
– インタプリタ(プロファイリング)
– C2
• Tiered Compilation
– インタプリタ(プロファイリング)
– プロファイリング付きの C1
– C2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
47
No Class Data Sharing
java
(HotSpot)
クラスデータ
(メモリ上)
java
(HotSpot)
クラスデータ
(メモリ上)
java
(HotSpot)
クラスデータ
(メモリ上)
java
(HotSpot)
クラスデータ
(メモリ上)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
48
Class Data Sharing
java
(HotSpot)
java
(HotSpot)
java
(HotSpot)
java
(HotSpot)
クラスデータ
classes.jsa
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
49
• Class Data Sharing
– Java SE のクラスライブラリ
• AppCDS
– アプリケーションのクラスも含む
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
50
AoT との共通点
• Tiered Compilation
– Warm up を早くしたい
• Class Data Sharing(CDS) / AppCDS
– Warm up を早くしたい
– メモリの使用量を減らしたい
AoT と異なる点
• マシン語を保存し、共用する機能
はない
少し似ている技術
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
51
Corporate Photography Collection
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
52
使い方
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
53
新しいツール: jaotc
MyClass.class my_class.sojaotc
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
54
$ jaotc --output libHelloAOT.so HelloAoT.class
jaotc
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
55
$ jaotc --help
Usage: jaotc <options> list
list A : separated list of class names, modules, jar files
or directories which contain class files.
where options include:
--output <file> Output file name
--class-name <class names> List of classes to compile
--jar <jarfiles> List of jar files to compile
--module <modules> List of modules to compile
--directory <dirs> List of directories where to search for files to compile
--search-path <dirs> List of directories where to search for specified files
--compile-commands <file> Name of file with compile commands
--compile-for-tiered Generate profiling code for tiered compilation
--compile-with-assertions Compile with java assertions
--compile-threads <number> Number of compilation threads to be used
--ignore-errors Ignores all exceptions thrown during class loading
--exit-on-error Exit on compilation errors
--info Print information during compilation
--verbose Print verbose information
--debug Print debug information
--help Print this usage message
--version Version information
-J<flag> Pass <flag> directly to the runtime system
jaotc (on-line help)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
56
$ jaotc --info --output libHelloAOT.so HelloAoT.class
Compiling libHelloAOT...
1 classes found (30 ms)
2 methods total, 2 methods to compile (4 ms)
Compiling with 8 threads
.
2 methods compiled, 0 methods failed (409 ms)
Parsing compiled code (1 ms)
Processing metadata (15 ms)
Preparing stubs binary (1 ms)
Preparing compiled binary (1 ms)
Creating binary: libHelloAOT.o (8 ms)
Creating shared library: libHelloAOT.so (13 ms)
Total time: 912 ms
jaotc (--info flag)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
57
$ jaotc --info --compile-with-assertions --output libHelloAOT.so HelloAoT.class
jaotc (--compile-with-assertions flag)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
58
$ jaotc --compile-commands cc.txt --output libHelloAOT.so HelloAoT.class
$ cat cc.txt
exclude org.sample.code.MyClass.method*
exclude org.sample.code.MyClass.<init>
jaotc (--compile-commands flag)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
59
$ jaotc --output libjava.base.so --module java.base
jaotc (module)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
60
$ jaotc --output libjava.base.so --jar my-spiffy-app.jar
jaotc (jar file)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
61
$ jaotc -J-XX:-UseCompressedOop --output libHelloAOT.so HelloAoT.class
意外に大事なオプション!(後ほど説明を。。。)
jaotc (VM options)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
62
$ java -XX:AOTLibrary=./libHelloAoT.so HelloAoT
実行時
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
63
$ java -XX:AOTLibrary=./libHelloAoT.so HelloAoT
Hello AoT!
$
実行時
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
64
$ java -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT
実行時 (-XX:+/-PrintAOT)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
65
$ builds/jdk-9/bin/java -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT
13 1 loaded ./libHelloAoT.so aot library
76 1 aot[ 1] HelloAoT.<init>()V
76 2 aot[ 1] HelloAoT.main([Ljava/lang/String;)V
Hello AoT!
$
実行時 (-XX:+/-PrintAOT)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
66
$ java -XX:-UseCompressedOops -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT
実行時 (圧縮 OOP を無効)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
67
$ java -XX:-UseCompressedOops -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT
Shared file ./libHelloAoT.so error: UseCompressedOops has different value 'true' from
current 'false'
7 1 skipped ./libHelloAoT.so aot library
Hello AoT!
$
実行時 (圧縮 OOP を無効)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
68
$ builds/jdk-9/bin/java -XX:-UseCompressedOops -XX:AOTLibrary=./libHelloAoT.so HelloAoT
Hello AoT!
$
実行時 (圧縮 OOP を無効)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
69
$ jaotc -J-XX:-UseCompressedOop --output libHelloAOT.so HelloAoT.class
jaotc (VM options を合わせましょう)
圧縮されたOOP 普通の OOP
G1 -J-XX:+UseCompressedOops
-J-XX:+UseG1GC
-J-XX:-UseCompressedOops
-J-XX:+UseG1GC
ParallelGC -J-XX:+UseCompressedOops
-J-XX:+UseParallelGC
-J-XX:-UseCompressedOops
-J-XX:+UseParallelGC
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
70
まとめ
• 価値
– Peak performance までの時間を短縮 ★
– 複数の JVM のメモリ使用量を減らす ★
– JITを使えないプラットフォームでも利用できる ★
• 注意点
– 実験的なもので、サポートされていない
– 正式なドキュメントはない
– AMD64 の Linux しか動かない
– Invoke dynamic や カスタムクラスローダーをサポートしない
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
71
まとめ
• 価値
– Peak performance までの時間を短縮 ★
– 複数の JVM のメモリ使用量を減らす ★
– JITを使えないプラットフォームでも利用できる ★
• 注意点
– 実験的なもので、サポートされていない
– 正式なドキュメントはない
– AMD64 の Linux しか動かない
– Invoke dynamic や カスタムクラスローダーをサポートしない
★ 場合があります。
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
72
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]

Mais conteúdo relacionado

Mais procurados

実運用して分かったRabbit MQの良いところ・気をつけること #jjug
実運用して分かったRabbit MQの良いところ・気をつけること #jjug実運用して分かったRabbit MQの良いところ・気をつけること #jjug
実運用して分かったRabbit MQの良いところ・気をつけること #jjugYahoo!デベロッパーネットワーク
 
ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4
ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4
ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4Yahoo!デベロッパーネットワーク
 
Cloud stack概要とaccel認定試験のご紹介
Cloud stack概要とaccel認定試験のご紹介Cloud stack概要とaccel認定試験のご紹介
Cloud stack概要とaccel認定試験のご紹介Tadashi Mishima
 
20131212 morphlabs okinawa_presentation
20131212 morphlabs okinawa_presentation20131212 morphlabs okinawa_presentation
20131212 morphlabs okinawa_presentationsaktomshu
 
Spring I/O 2017 報告 ThymeleafのWebFlux対応
Spring I/O 2017 報告 ThymeleafのWebFlux対応Spring I/O 2017 報告 ThymeleafのWebFlux対応
Spring I/O 2017 報告 ThymeleafのWebFlux対応Takuya Iwatsuka
 
機械学習ハンズオン
機械学習ハンズオン機械学習ハンズオン
機械学習ハンズオン幹雄 小川
 
Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Takuya Iwatsuka
 
楽天がCloud foundryを選んだ理由
楽天がCloud foundryを選んだ理由楽天がCloud foundryを選んだ理由
楽天がCloud foundryを選んだ理由Rakuten Group, Inc.
 
Oracle advanced analyticsによる機械学習full version
Oracle advanced analyticsによる機械学習full versionOracle advanced analyticsによる機械学習full version
Oracle advanced analyticsによる機械学習full version幹雄 小川
 
おすすめインフラ! for スタートアップ
おすすめインフラ! for スタートアップおすすめインフラ! for スタートアップ
おすすめインフラ! for スタートアップKoichiro Sumi
 

Mais procurados (16)

実運用して分かったRabbit MQの良いところ・気をつけること #jjug
実運用して分かったRabbit MQの良いところ・気をつけること #jjug実運用して分かったRabbit MQの良いところ・気をつけること #jjug
実運用して分かったRabbit MQの良いところ・気をつけること #jjug
 
ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4
ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4
ヤフーの広告レポートシステムをSpring Cloud Stream化するまで #jjug_ccc #ccc_a4
 
Cloud stack概要とaccel認定試験のご紹介
Cloud stack概要とaccel認定試験のご紹介Cloud stack概要とaccel認定試験のご紹介
Cloud stack概要とaccel認定試験のご紹介
 
Hive on Tezのベストプラクティス
Hive on TezのベストプラクティスHive on Tezのベストプラクティス
Hive on Tezのベストプラクティス
 
20131212 morphlabs okinawa_presentation
20131212 morphlabs okinawa_presentation20131212 morphlabs okinawa_presentation
20131212 morphlabs okinawa_presentation
 
Spring I/O 2017 報告 ThymeleafのWebFlux対応
Spring I/O 2017 報告 ThymeleafのWebFlux対応Spring I/O 2017 報告 ThymeleafのWebFlux対応
Spring I/O 2017 報告 ThymeleafのWebFlux対応
 
機械学習ハンズオン
機械学習ハンズオン機械学習ハンズオン
機械学習ハンズオン
 
Design pattern in presto source code
Design pattern in presto source codeDesign pattern in presto source code
Design pattern in presto source code
 
Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門
 
楽天がCloud foundryを選んだ理由
楽天がCloud foundryを選んだ理由楽天がCloud foundryを選んだ理由
楽天がCloud foundryを選んだ理由
 
Spring social の基礎
Spring social の基礎Spring social の基礎
Spring social の基礎
 
YJTC18 A-1 大規模サーバの戦略
YJTC18 A-1 大規模サーバの戦略YJTC18 A-1 大規模サーバの戦略
YJTC18 A-1 大規模サーバの戦略
 
Oracle advanced analyticsによる機械学習full version
Oracle advanced analyticsによる機械学習full versionOracle advanced analyticsによる機械学習full version
Oracle advanced analyticsによる機械学習full version
 
おすすめインフラ! for スタートアップ
おすすめインフラ! for スタートアップおすすめインフラ! for スタートアップ
おすすめインフラ! for スタートアップ
 
Elasticsearch勉強会
Elasticsearch勉強会Elasticsearch勉強会
Elasticsearch勉強会
 
検索基盤Qass
検索基盤Qass検索基盤Qass
検索基盤Qass
 

Semelhante a Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]

Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうかWebアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうかChihiro Ito
 
Nashorn in the future (Japanese)
Nashorn in the future (Japanese)Nashorn in the future (Japanese)
Nashorn in the future (Japanese)Logico
 
DataEngConf NYC’18 セッションサマリー #2
DataEngConf NYC’18 セッションサマリー #2DataEngConf NYC’18 セッションサマリー #2
DataEngConf NYC’18 セッションサマリー #2gree_tech
 
Oracle APEXユーザー会の紹介
Oracle APEXユーザー会の紹介Oracle APEXユーザー会の紹介
Oracle APEXユーザー会の紹介Nakakoshi Yuji
 
MySQLインストールのお作法
MySQLインストールのお作法MySQLインストールのお作法
MySQLインストールのお作法Meiji Kimura
 
Autonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーションAutonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーションオラクルエンジニア通信
 
2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage PlatformMasaki Nakagawa
 
Dockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 Tokyo
Dockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 TokyoDockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 Tokyo
Dockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 TokyoTakao Setaka
 
Ossを使ったazureでのdev ops
Ossを使ったazureでのdev opsOssを使ったazureでのdev ops
Ossを使ったazureでのdev ops裕貴 荒井
 
OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)
OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)
OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)Satoshi Konno
 
今年はJava進化の年!今知っておくべき新しいJava
今年はJava進化の年!今知っておくべき新しいJava今年はJava進化の年!今知っておくべき新しいJava
今年はJava進化の年!今知っておくべき新しいJavaTakashi Ito
 
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1近藤 繁延
 
最近のWeb関連技術の動向あれこれ
最近のWeb関連技術の動向あれこれ最近のWeb関連技術の動向あれこれ
最近のWeb関連技術の動向あれこれdsuke Takaoka
 
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーDBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーMasaya Ishikawa
 
20180220 AWS Black Belt Online Seminar - Amazon Container Services
20180220 AWS Black Belt Online Seminar - Amazon Container Services20180220 AWS Black Belt Online Seminar - Amazon Container Services
20180220 AWS Black Belt Online Seminar - Amazon Container ServicesAmazon Web Services Japan
 

Semelhante a Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1] (20)

Spring Boot on Kubernetes : Yahoo!ズバトク事例 #jjug_ccc
Spring Boot on Kubernetes : Yahoo!ズバトク事例 #jjug_cccSpring Boot on Kubernetes : Yahoo!ズバトク事例 #jjug_ccc
Spring Boot on Kubernetes : Yahoo!ズバトク事例 #jjug_ccc
 
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうかWebアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
Webアプリに低レイテンシ・高可用性を求めるのは間違っているのだろうか
 
Nashorn in the future (Japanese)
Nashorn in the future (Japanese)Nashorn in the future (Japanese)
Nashorn in the future (Japanese)
 
DataEngConf NYC’18 セッションサマリー #2
DataEngConf NYC’18 セッションサマリー #2DataEngConf NYC’18 セッションサマリー #2
DataEngConf NYC’18 セッションサマリー #2
 
Oracle APEXユーザー会の紹介
Oracle APEXユーザー会の紹介Oracle APEXユーザー会の紹介
Oracle APEXユーザー会の紹介
 
MySQLインストールのお作法
MySQLインストールのお作法MySQLインストールのお作法
MySQLインストールのお作法
 
Autonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーションAutonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーション
 
2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform
 
Tech deepdive#2 datastore_180317_share
Tech deepdive#2 datastore_180317_shareTech deepdive#2 datastore_180317_share
Tech deepdive#2 datastore_180317_share
 
Dockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 Tokyo
Dockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 TokyoDockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 Tokyo
Dockerのエンタープライズ運用を支える技術 - FlexPod Day 2017 Tokyo
 
Ossを使ったazureでのdev ops
Ossを使ったazureでのdev opsOssを使ったazureでのdev ops
Ossを使ったazureでのdev ops
 
Java Clientで入門する Apache Kafka #jjug_ccc #ccc_e2
Java Clientで入門する Apache Kafka #jjug_ccc #ccc_e2Java Clientで入門する Apache Kafka #jjug_ccc #ccc_e2
Java Clientで入門する Apache Kafka #jjug_ccc #ccc_e2
 
OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)
OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)
OpenStack Days Tokyo 2014のプレゼンテーション資料(モーフ・ラボ & アセアン・ラボ)
 
今年はJava進化の年!今知っておくべき新しいJava
今年はJava進化の年!今知っておくべき新しいJava今年はJava進化の年!今知っておくべき新しいJava
今年はJava進化の年!今知っておくべき新しいJava
 
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol1
 
最近のWeb関連技術の動向あれこれ
最近のWeb関連技術の動向あれこれ最近のWeb関連技術の動向あれこれ
最近のWeb関連技術の動向あれこれ
 
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーDBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
 
20180220 AWS Black Belt Online Seminar - Amazon Container Services
20180220 AWS Black Belt Online Seminar - Amazon Container Services20180220 AWS Black Belt Online Seminar - Amazon Container Services
20180220 AWS Black Belt Online Seminar - Amazon Container Services
 
JDK: 新しいリリースモデル解説(ver.2.0)
JDK: 新しいリリースモデル解説(ver.2.0)JDK: 新しいリリースモデル解説(ver.2.0)
JDK: 新しいリリースモデル解説(ver.2.0)
 
JDK:新しいリリースモデル解説 @ 岡山・広島
JDK:新しいリリースモデル解説 @ 岡山・広島JDK:新しいリリースモデル解説 @ 岡山・広島
JDK:新しいリリースモデル解説 @ 岡山・広島
 

Mais de David Buck

JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]David Buck
 
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...David Buck
 
Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]David Buck
 
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...David Buck
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]David Buck
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...David Buck
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]David Buck
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage CollectorDavid Buck
 
Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019David Buck
 
Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018David Buck
 
JDK 10 へようこそ
JDK 10 へようこそJDK 10 へようこそ
JDK 10 へようこそDavid Buck
 
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]David Buck
 
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]David Buck
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]David Buck
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]David Buck
 
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]David Buck
 
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]David Buck
 
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]David Buck
 

Mais de David Buck (20)

JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
 
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
 
Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]Java Bytecode Crash Course [Code One 2019]
Java Bytecode Crash Course [Code One 2019]
 
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
 
invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]invokedynamic for Mere Mortals [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
 
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
 
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
 
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage Collector
 
Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019Valhalla Update JJUG CCC Spring 2019
Valhalla Update JJUG CCC Spring 2019
 
Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018Var handles jjug_ccc_spring_2018
Var handles jjug_ccc_spring_2018
 
JDK 10 へようこそ
JDK 10 へようこそJDK 10 へようこそ
JDK 10 へようこそ
 
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
 
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ  JVM 特集  2015年8月]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
 
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
 
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
 
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
 
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
 

Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]

  • 1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Ahead-of-Time Compilation with JDK 9 日本オラクル株式会社 Java SE Sustaining Engineering バック デイビッド Java Day Tokyo 2017 2017年5月17日
  • 2. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 2 Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 3 • JVM Sustaining Engineer • OpenJDK 8 Update Project Maintainer • JavaOne Rock Star • Co-author of Oracle WebLogic Server 11g 構築・運用ガイド • @DavidBuckJP • https://blogs.oracle.com/buck/ Hi There!
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 4 Program Agenda 注意点 AoT のいろは 似ている機能 使い方 1 2 3 4
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 5 注意点
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 6 要注意 • AoT は実験的なものであり、正式にはサポートされていない
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 7 要注意 • AoT は実験的なものであり、正式にはサポートされていない • 現時点では、AMD64 の Linux しかサポートされていない
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 8 要注意 • AoT は実験的なものであり、正式にはサポートされていない • 現時点では、AMD64 の Linux しかサポートされていない • 正式なドキュメントはない(JEP のみ)
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 9 要注意 • AoT は実験的なものであり、正式にはサポートされていない • 現時点では、AMD64 の Linux しかサポートされていない • 正式なドキュメントはない(JEP のみ) • 現時点では、将来的にサポートされる予定はない
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 10 AoT のいろは
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 11 AoT を勉強する価値
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 12 AoT を勉強する価値 • 将来にサポートされるようになる可能性がある
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 13 AoT を勉強する価値 • 将来にサポートされるようになる可能性がある • HotSpot の他の機能を勉強するきっかけである
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14 AoT を勉強する価値 • 将来にサポートされるようになる可能性がある • HotSpot の他の機能を勉強するきっかけである • やはり、面白い!
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 15 Java Build / Execution Model (Interpreter) MyClass.java MyClass.class java (HotSpot) javac
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 16 Java Build / Execution Model (JIT) MyClass.java MyClass.class java (HotSpot) javac マシン語 (メモリ上)
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 17 Just in Time Compilation (JIT)
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 18 Just in Time Compilation (JIT) • メソッドがコンパイルされる
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 19 Just in Time Compilation (JIT) • メソッドがコンパイルされる • コンパイル処理は重い
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 20 Just in Time Compilation (JIT) • メソッドがコンパイルされる • コンパイル処理は重い • マシン語のバージョンは早い
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 21 Just in Time Compilation (JIT) • メソッドがコンパイルされる • コンパイル処理は重い • マシン語のバージョンは早い • パフォーマンスは interpreter よりいい?
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22 Just in Time Compilation (JIT)
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 23 Just in Time Compilation (JIT)
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 24 Just in Time Compilation (JIT) パフォーマンスは interpreter よりいい?
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 25 Just in Time Compilation (JIT) パフォーマンスは interpreter よりいい? パフォーマンスの定義次第
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 26 $ time ./hello_jdt Hello JavaDay Tokyo! real 0m0.002s user 0m0.001s $ time java HelloJDT Hello JavaDay Tokyo! real 0m0.104s user 0m0.077s sys 0m0.020s Just in Time Compilation (JIT)
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 27 Just in Time Compilation (JIT) 弱点 • コンパイル処理が重い – メソッドを実行出来るようになるまで時間かかる – メモリの使用量が大きい • Hot ではないメソッドの場合、interpreter のほうが適切
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 28 Just in Time Compilation (JIT) (HotSpot の実装) • まず、 すべてのメソッドは interpreter のみで実行 • サンプリングで Hot なメソッドを検出 • Hot のメソッドだけをコンパイル • Hot ではないメソッドは interpreter で実行
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 29 HotSpot のJIT でも • アプリの起動が時間がかかる • 起動しても、最高のパフォーマンスまで時間がかかる • コンパイル処理がメモリを消費する • 実行時にマシン語を生成出来ないプラットフォームもある ネイティブ(C/C++ などと比べると)
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 30 Just in Time Compilation (JIT) (HotSpot の実装) 2コンパイラ物語 • C2 – Server 用 – 最適化を頑張る – Interpreter が収集するプロファイリングデータを参考する – デフォルト CompileThreshold : 10000 • C1 – Client 用 – 最適化はあまりしない – プロファイリングデータをあまり利用しない – デフォルト CompileThreshold : 1500
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 31 Ahead of Time (AoT) の戦略 • 実行の前にマシン語を生成しておく • 実行時に既存のマシン語をロードして実行する • 実行時にマシン語を生成する必要はなくなる
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 32 Java Build / Execution Model (AoT) MyClass.java MyClass.class java (HotSpot) javac マシン語 (メモリ上)
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 33 Java Build / Execution Model (AoT) MyClass.java MyClass.class java (HotSpot) javac my_class.so jaotc
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 34 Java Build / Execution Model java (HotSpot) マシン語 (メモリ上) java (HotSpot) マシン語 (メモリ上) java (HotSpot) マシン語 (メモリ上) java (HotSpot) マシン語 (メモリ上)
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 35 Java Build / Execution Model java (HotSpot) java (HotSpot) java (HotSpot) java (HotSpot) my_class.so
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 36 Ahead of Time (AoT) の戦略
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 37 Ahead of Time (AoT) の戦略 • アプリの起動が早くなる ★
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 38 Ahead of Time (AoT) の戦略 • アプリの起動が早くなる ★ • peak performance / steady state まですぐ達成する ★
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 39 Ahead of Time (AoT) の戦略 • アプリの起動が早くなる ★ • peak performance / steady state まですぐ達成する ★ • コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★
  • 40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 40 Ahead of Time (AoT) の戦略 • アプリの起動が早くなる ★ • peak performance / steady state まですぐ達成する ★ • コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★ • 同じマシン語のデータを共有することが出来る ★
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 41 Ahead of Time (AoT) の戦略 • アプリの起動が早くなる ★ • peak performance / steady state まですぐ達成する ★ • コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★ • 同じマシン語のデータを共有することが出来る ★ • 実行時にマシン語を生成出来ないプラットフォームでも利用できる ★
  • 42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 42 Ahead of Time (AoT) の戦略 • アプリの起動が早くなる ★ • peak performance / steady state まですぐ達成する ★ • コンパイルの負荷( CPU 使用 / メモリの消費)を減らす ★ • 同じマシン語のデータを共有することが出来る ★ • 実行時にマシン語を生成出来ないプラットフォームでも利用できる ★ ★ 場合がある
  • 43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 43 ?
  • 44. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 44 似ている機能
  • 45. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 45 少し似ている技術 • Tiered Compilation • Class Data Sharing(CDS) / AppCDS
  • 46. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 46 Tiered Compilation • 従来の server JVM – インタプリタ(プロファイリング) – C2 • Tiered Compilation – インタプリタ(プロファイリング) – プロファイリング付きの C1 – C2
  • 47. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 47 No Class Data Sharing java (HotSpot) クラスデータ (メモリ上) java (HotSpot) クラスデータ (メモリ上) java (HotSpot) クラスデータ (メモリ上) java (HotSpot) クラスデータ (メモリ上)
  • 48. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 48 Class Data Sharing java (HotSpot) java (HotSpot) java (HotSpot) java (HotSpot) クラスデータ classes.jsa
  • 49. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 49 • Class Data Sharing – Java SE のクラスライブラリ • AppCDS – アプリケーションのクラスも含む
  • 50. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 50 AoT との共通点 • Tiered Compilation – Warm up を早くしたい • Class Data Sharing(CDS) / AppCDS – Warm up を早くしたい – メモリの使用量を減らしたい AoT と異なる点 • マシン語を保存し、共用する機能 はない 少し似ている技術
  • 51. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 51 Corporate Photography Collection
  • 52. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 52 使い方
  • 53. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 53 新しいツール: jaotc MyClass.class my_class.sojaotc
  • 54. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 54 $ jaotc --output libHelloAOT.so HelloAoT.class jaotc
  • 55. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 55 $ jaotc --help Usage: jaotc <options> list list A : separated list of class names, modules, jar files or directories which contain class files. where options include: --output <file> Output file name --class-name <class names> List of classes to compile --jar <jarfiles> List of jar files to compile --module <modules> List of modules to compile --directory <dirs> List of directories where to search for files to compile --search-path <dirs> List of directories where to search for specified files --compile-commands <file> Name of file with compile commands --compile-for-tiered Generate profiling code for tiered compilation --compile-with-assertions Compile with java assertions --compile-threads <number> Number of compilation threads to be used --ignore-errors Ignores all exceptions thrown during class loading --exit-on-error Exit on compilation errors --info Print information during compilation --verbose Print verbose information --debug Print debug information --help Print this usage message --version Version information -J<flag> Pass <flag> directly to the runtime system jaotc (on-line help)
  • 56. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 56 $ jaotc --info --output libHelloAOT.so HelloAoT.class Compiling libHelloAOT... 1 classes found (30 ms) 2 methods total, 2 methods to compile (4 ms) Compiling with 8 threads . 2 methods compiled, 0 methods failed (409 ms) Parsing compiled code (1 ms) Processing metadata (15 ms) Preparing stubs binary (1 ms) Preparing compiled binary (1 ms) Creating binary: libHelloAOT.o (8 ms) Creating shared library: libHelloAOT.so (13 ms) Total time: 912 ms jaotc (--info flag)
  • 57. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 57 $ jaotc --info --compile-with-assertions --output libHelloAOT.so HelloAoT.class jaotc (--compile-with-assertions flag)
  • 58. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 58 $ jaotc --compile-commands cc.txt --output libHelloAOT.so HelloAoT.class $ cat cc.txt exclude org.sample.code.MyClass.method* exclude org.sample.code.MyClass.<init> jaotc (--compile-commands flag)
  • 59. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 59 $ jaotc --output libjava.base.so --module java.base jaotc (module)
  • 60. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 60 $ jaotc --output libjava.base.so --jar my-spiffy-app.jar jaotc (jar file)
  • 61. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 61 $ jaotc -J-XX:-UseCompressedOop --output libHelloAOT.so HelloAoT.class 意外に大事なオプション!(後ほど説明を。。。) jaotc (VM options)
  • 62. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 62 $ java -XX:AOTLibrary=./libHelloAoT.so HelloAoT 実行時
  • 63. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 63 $ java -XX:AOTLibrary=./libHelloAoT.so HelloAoT Hello AoT! $ 実行時
  • 64. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 64 $ java -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT 実行時 (-XX:+/-PrintAOT)
  • 65. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 65 $ builds/jdk-9/bin/java -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT 13 1 loaded ./libHelloAoT.so aot library 76 1 aot[ 1] HelloAoT.<init>()V 76 2 aot[ 1] HelloAoT.main([Ljava/lang/String;)V Hello AoT! $ 実行時 (-XX:+/-PrintAOT)
  • 66. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 66 $ java -XX:-UseCompressedOops -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT 実行時 (圧縮 OOP を無効)
  • 67. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 67 $ java -XX:-UseCompressedOops -XX:+PrintAOT -XX:AOTLibrary=./libHelloAoT.so HelloAoT Shared file ./libHelloAoT.so error: UseCompressedOops has different value 'true' from current 'false' 7 1 skipped ./libHelloAoT.so aot library Hello AoT! $ 実行時 (圧縮 OOP を無効)
  • 68. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 68 $ builds/jdk-9/bin/java -XX:-UseCompressedOops -XX:AOTLibrary=./libHelloAoT.so HelloAoT Hello AoT! $ 実行時 (圧縮 OOP を無効)
  • 69. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 69 $ jaotc -J-XX:-UseCompressedOop --output libHelloAOT.so HelloAoT.class jaotc (VM options を合わせましょう) 圧縮されたOOP 普通の OOP G1 -J-XX:+UseCompressedOops -J-XX:+UseG1GC -J-XX:-UseCompressedOops -J-XX:+UseG1GC ParallelGC -J-XX:+UseCompressedOops -J-XX:+UseParallelGC -J-XX:-UseCompressedOops -J-XX:+UseParallelGC
  • 70. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 70 まとめ • 価値 – Peak performance までの時間を短縮 ★ – 複数の JVM のメモリ使用量を減らす ★ – JITを使えないプラットフォームでも利用できる ★ • 注意点 – 実験的なもので、サポートされていない – 正式なドキュメントはない – AMD64 の Linux しか動かない – Invoke dynamic や カスタムクラスローダーをサポートしない
  • 71. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 71 まとめ • 価値 – Peak performance までの時間を短縮 ★ – 複数の JVM のメモリ使用量を減らす ★ – JITを使えないプラットフォームでも利用できる ★ • 注意点 – 実験的なもので、サポートされていない – 正式なドキュメントはない – AMD64 の Linux しか動かない – Invoke dynamic や カスタムクラスローダーをサポートしない ★ 場合があります。
  • 72. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 72