SlideShare a Scribd company logo
1 of 23
Download to read offline
GraalVM
Oracle Code One in 2018/11/17
LINE Fukuoka
•
• LINE Fukuoka
• @kis
• Oracle Code One
• Oracle Code One
• GraalVM
• GraalVM
Oracle Code One
• JavaOne
• Java
• Sun Francisco Moscone Center West
• Beck
• Marriortt
•
Marriott
• Marriott Westin
• One Job Enough
•
( )
•
• → → →
• 2
• JDK11 with JShell(120 )
•
(45 )
https://qiita.com/nowokay/items/80e8ccd50f6749846dd6
GraalVM
• Oracle JVM
• http://www.graalvm.org/
• Graal + Truffle
• Polyglot
• JS, Python, Ruby, …
•
GraalVM and MicroProfile: A Polyglot Microservices Solution [DEV6016]
Graal
• Java JIT
• C2
Client(C1) Server(C2)
Compiler Interface
HotSpot
Graal
JVMCI
HotSpot
Written in Java
Truffle Sulong
• Truffle
•
• AST GC
• LLVM
• Sulong
• LLVM bitcode -> Truffle AST
• LLVM
• Rust, Swift, C…
Polyglot
• Truffle
• JavaScript(Graal JS), Ruby(TruffleRuby), Python, R…
•
•
• Oracle MySQL SQL JavaScript
• Java
• SubstrateVM
Instant Startup and Low Footprint for Java [DEV5705]
GraalVM in Oracle Code One 2018
• graal 10
• Vision and Roadmap
• GraalVM JavaScript
vue ( )
GraalVM
• JVM
• Polyglot
• LLVM
•
• See also
• Ten Things You Can Do with GraalVM - BYOL [HOL5576]
• Instant Startup and Low Footprint for Java [DEV5705]
VM
• JIT
• Also available with JDK11
java -XX:+UnlockExperimentalVMOptions
-XX:+EnableJVMCI
-XX:+UseJVMXCICompiler Hello
• Oracle Code One
•
•
0
2
4
6
8
10
12
14
16
18
( )
JDK8 JDK11 JDK11+Graal GraalVM
https://github.com/kishida/smallpt4j/blob/original/src/main/java/naoki/smallpt/SmallPT.java
•
• Graal
• Graal
• JIT Graal
2172 5376 1 org.graalvm.compiler.lir.amd64.AMD64Move::canMoveConst2Stack (81 bytes)
2172 5377 1 org.graalvm.compiler.core.amd64.AMD64NodeMatchRules$1::<init> (50 bytes)
2172 5385 1 org.graalvm.compiler.core.common.type.ObjectStamp::getLIRKind (7 bytes)
2172 5386 1 org.graalvm.compiler.core.amd64.AMD64ArithmeticLIRGenerator::emitAdd (232 bytes)
2174 5387 1 org.graalvm.compiler.lir.gen.LIRGenerator::emitJavaConstant (16 bytes)
2174 5378 1 org.graalvm.compiler.core.amd64.AMD64NodeMatchRules$1::evaluate (181 bytes)
2175 5388 1 org.graalvm.compiler.core.common.type.FloatStamp::getLIRKind (11 bytes)
2175 5392 3 org.graalvm.collections.EconomicMapImpl$1::iterator (9 bytes)
2175 5393 3 org.graalvm.collections.EconomicMapImpl$1$1::<init> (15 bytes)
Polyglot
• JavaScript Java
$ js --jvm --polyglot
> var BigInteger = Java.type(‘BigInteger’)
> BigInteger.valueOf(123).pow(10).toString()
• JavaScript Ruby
> Interop.eval(‘ruby’, ‘print “hello”’)
LLVM
• Rust
$ rustc --emit=llvm-bc main.rs
$ lli --lib $(rustc --print sysroot)/lib/libstd-* main.bc
•
$ native-image Hello
$ ./Hello
•
• 46 (JDK11 11 , GraalVM 17 )
• ->10MB
• GraalVM 1.0 RC1
ImageIO
graaldemo $ time java Hello
Hello!
real 0m0.103s
user 0m0.068s
sys 0m0.025s
graaldemo $ time ./hello
Hello!
real 0m0.013s
user 0m0.005s
sys 0m0.006s
• GraalVM

More Related Content

More from なおき きしだ

プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会
プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会
プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会なおき きしだ
 
これからのコンピューティングの変化とこれからのプログラミング at 広島
これからのコンピューティングの変化とこれからのプログラミング at 広島これからのコンピューティングの変化とこれからのプログラミング at 広島
これからのコンピューティングの変化とこれからのプログラミング at 広島なおき きしだ
 
Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11なおき きしだ
 
Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11なおき きしだ
 
Java10 and Java11 at JJUG CCC 2018 Spr
Java10 and Java11 at JJUG CCC 2018 SprJava10 and Java11 at JJUG CCC 2018 Spr
Java10 and Java11 at JJUG CCC 2018 Sprなおき きしだ
 
New thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should knowNew thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should knowなおき きしだ
 
Java Release Model (on Scala Matsuri)
Java Release Model (on Scala Matsuri)Java Release Model (on Scala Matsuri)
Java Release Model (on Scala Matsuri)なおき きしだ
 
これからのJava言語と実行環境
これからのJava言語と実行環境これからのJava言語と実行環境
これからのJava言語と実行環境なおき きしだ
 
JavaOne2017で感じた、Javaのいまと未来 in 大阪
JavaOne2017で感じた、Javaのいまと未来 in 大阪JavaOne2017で感じた、Javaのいまと未来 in 大阪
JavaOne2017で感じた、Javaのいまと未来 in 大阪なおき きしだ
 
Java8 コーディングベストプラクティス and NetBeansのメモリログから...
Java8 コーディングベストプラクティス and NetBeansのメモリログから...Java8 コーディングベストプラクティス and NetBeansのメモリログから...
Java8 コーディングベストプラクティス and NetBeansのメモリログから...なおき きしだ
 
NetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定する
NetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定するNetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定する
NetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定するなおき きしだ
 
コンピューティングとJava~なにわTECH道
コンピューティングとJava~なにわTECH道コンピューティングとJava~なにわTECH道
コンピューティングとJava~なにわTECH道なおき きしだ
 
人工知能に何ができないか
人工知能に何ができないか人工知能に何ができないか
人工知能に何ができないかなおき きしだ
 
JavaOne2015報告またはこれからのJava
JavaOne2015報告またはこれからのJavaJavaOne2015報告またはこれからのJava
JavaOne2015報告またはこれからのJavaなおき きしだ
 
これからのコンピューティングの変化とJava-JJUG CCC 2015 Fall
これからのコンピューティングの変化とJava-JJUG CCC 2015 Fallこれからのコンピューティングの変化とJava-JJUG CCC 2015 Fall
これからのコンピューティングの変化とJava-JJUG CCC 2015 Fallなおき きしだ
 

More from なおき きしだ (20)

プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会
プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会
プログラマになるためになにを勉強するか at 九州学生エンジニアLT大会
 
これからのコンピューティングの変化とこれからのプログラミング at 広島
これからのコンピューティングの変化とこれからのプログラミング at 広島これからのコンピューティングの変化とこれからのプログラミング at 広島
これからのコンピューティングの変化とこれからのプログラミング at 広島
 
Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11
 
Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11Summary of JDK10 and What will come into JDK11
Summary of JDK10 and What will come into JDK11
 
Java10 and Java11 at JJUG CCC 2018 Spr
Java10 and Java11 at JJUG CCC 2018 SprJava10 and Java11 at JJUG CCC 2018 Spr
Java10 and Java11 at JJUG CCC 2018 Spr
 
New thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should knowNew thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should know
 
Java Release Model (on Scala Matsuri)
Java Release Model (on Scala Matsuri)Java Release Model (on Scala Matsuri)
Java Release Model (on Scala Matsuri)
 
これからのJava言語と実行環境
これからのJava言語と実行環境これからのJava言語と実行環境
これからのJava言語と実行環境
 
JavaOne報告2017
JavaOne報告2017JavaOne報告2017
JavaOne報告2017
 
JavaOne2017で感じた、Javaのいまと未来 in 大阪
JavaOne2017で感じた、Javaのいまと未来 in 大阪JavaOne2017で感じた、Javaのいまと未来 in 大阪
JavaOne2017で感じた、Javaのいまと未来 in 大阪
 
Java8 コーディングベストプラクティス and NetBeansのメモリログから...
Java8 コーディングベストプラクティス and NetBeansのメモリログから...Java8 コーディングベストプラクティス and NetBeansのメモリログから...
Java8 コーディングベストプラクティス and NetBeansのメモリログから...
 
NetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定する
NetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定するNetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定する
NetBeansのメモリ使用ログから機械学習できしだが働いてるかどうか判定する
 
JavaOne2016報告
JavaOne2016報告JavaOne2016報告
JavaOne2016報告
 
コンピューティングとJava~なにわTECH道
コンピューティングとJava~なにわTECH道コンピューティングとJava~なにわTECH道
コンピューティングとJava~なにわTECH道
 
Javaプログラミング入門
Javaプログラミング入門Javaプログラミング入門
Javaプログラミング入門
 
人工知能に何ができないか
人工知能に何ができないか人工知能に何ができないか
人工知能に何ができないか
 
乱数のたのしい話
乱数のたのしい話乱数のたのしい話
乱数のたのしい話
 
JavaOne2015報告またはこれからのJava
JavaOne2015報告またはこれからのJavaJavaOne2015報告またはこれからのJava
JavaOne2015報告またはこれからのJava
 
これからのコンピューティングの変化とJava-JJUG CCC 2015 Fall
これからのコンピューティングの変化とJava-JJUG CCC 2015 Fallこれからのコンピューティングの変化とJava-JJUG CCC 2015 Fall
これからのコンピューティングの変化とJava-JJUG CCC 2015 Fall
 
機械学習プロ生20151121
機械学習プロ生20151121機械学習プロ生20151121
機械学習プロ生20151121
 

GraalVMについて

  • 1. GraalVM Oracle Code One in 2018/11/17 LINE Fukuoka
  • 2. • • LINE Fukuoka • @kis • Oracle Code One
  • 3. • Oracle Code One • GraalVM • GraalVM
  • 4. Oracle Code One • JavaOne • Java • Sun Francisco Moscone Center West • Beck
  • 6. Marriott • Marriott Westin • One Job Enough • ( )
  • 8. • 2 • JDK11 with JShell(120 ) • (45 ) https://qiita.com/nowokay/items/80e8ccd50f6749846dd6
  • 9. GraalVM • Oracle JVM • http://www.graalvm.org/ • Graal + Truffle • Polyglot • JS, Python, Ruby, … •
  • 10. GraalVM and MicroProfile: A Polyglot Microservices Solution [DEV6016]
  • 11. Graal • Java JIT • C2 Client(C1) Server(C2) Compiler Interface HotSpot Graal JVMCI HotSpot Written in Java
  • 12. Truffle Sulong • Truffle • • AST GC • LLVM • Sulong • LLVM bitcode -> Truffle AST • LLVM • Rust, Swift, C…
  • 13. Polyglot • Truffle • JavaScript(Graal JS), Ruby(TruffleRuby), Python, R… • • • Oracle MySQL SQL JavaScript
  • 14. • Java • SubstrateVM Instant Startup and Low Footprint for Java [DEV5705]
  • 15. GraalVM in Oracle Code One 2018 • graal 10 • Vision and Roadmap • GraalVM JavaScript vue ( )
  • 16. GraalVM • JVM • Polyglot • LLVM • • See also • Ten Things You Can Do with GraalVM - BYOL [HOL5576] • Instant Startup and Low Footprint for Java [DEV5705]
  • 17. VM • JIT • Also available with JDK11 java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMXCICompiler Hello • Oracle Code One
  • 18. • • 0 2 4 6 8 10 12 14 16 18 ( ) JDK8 JDK11 JDK11+Graal GraalVM https://github.com/kishida/smallpt4j/blob/original/src/main/java/naoki/smallpt/SmallPT.java
  • 19. • • Graal • Graal • JIT Graal 2172 5376 1 org.graalvm.compiler.lir.amd64.AMD64Move::canMoveConst2Stack (81 bytes) 2172 5377 1 org.graalvm.compiler.core.amd64.AMD64NodeMatchRules$1::<init> (50 bytes) 2172 5385 1 org.graalvm.compiler.core.common.type.ObjectStamp::getLIRKind (7 bytes) 2172 5386 1 org.graalvm.compiler.core.amd64.AMD64ArithmeticLIRGenerator::emitAdd (232 bytes) 2174 5387 1 org.graalvm.compiler.lir.gen.LIRGenerator::emitJavaConstant (16 bytes) 2174 5378 1 org.graalvm.compiler.core.amd64.AMD64NodeMatchRules$1::evaluate (181 bytes) 2175 5388 1 org.graalvm.compiler.core.common.type.FloatStamp::getLIRKind (11 bytes) 2175 5392 3 org.graalvm.collections.EconomicMapImpl$1::iterator (9 bytes) 2175 5393 3 org.graalvm.collections.EconomicMapImpl$1$1::<init> (15 bytes)
  • 20. Polyglot • JavaScript Java $ js --jvm --polyglot > var BigInteger = Java.type(‘BigInteger’) > BigInteger.valueOf(123).pow(10).toString() • JavaScript Ruby > Interop.eval(‘ruby’, ‘print “hello”’)
  • 21. LLVM • Rust $ rustc --emit=llvm-bc main.rs $ lli --lib $(rustc --print sysroot)/lib/libstd-* main.bc
  • 22. • $ native-image Hello $ ./Hello • • 46 (JDK11 11 , GraalVM 17 ) • ->10MB • GraalVM 1.0 RC1 ImageIO graaldemo $ time java Hello Hello! real 0m0.103s user 0m0.068s sys 0m0.025s graaldemo $ time ./hello Hello! real 0m0.013s user 0m0.005s sys 0m0.006s