SlideShare a Scribd company logo
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

PDF
GraalVM at Fukuoka LT
PPT
Ninja dojo
PDF
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
PDF
これからのコンピューティングの変化とこれからのプログラミング in 福岡 2018/12/8
PDF
VRカメラが楽しいのでブラウザで見たくなった話
PDF
最近のJava事情
PDF
怖いコードの話 2018/7/18
PDF
Java新機能観察日記 - JJUGナイトセミナー
GraalVM at Fukuoka LT
Ninja dojo
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
これからのコンピューティングの変化とこれからのプログラミング in 福岡 2018/12/8
VRカメラが楽しいのでブラウザで見たくなった話
最近のJava事情
怖いコードの話 2018/7/18
Java新機能観察日記 - JJUGナイトセミナー

More from なおき きしだ (20)

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

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