Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GraalVMについて

1,884 views

Published on

2018年11月17日のOracle Code One 2018報告会 in 東京での登壇資料です

Published in: Technology
  • Be the first to comment

GraalVMについて

  1. 1. GraalVM Oracle Code One in 2018/11/17 LINE Fukuoka
  2. 2. • • LINE Fukuoka • @kis • Oracle Code One
  3. 3. • Oracle Code One • GraalVM • GraalVM
  4. 4. Oracle Code One • JavaOne • Java • Sun Francisco Moscone Center West • Beck
  5. 5. • Marriortt •
  6. 6. Marriott • Marriott Westin • One Job Enough • ( )
  7. 7. • • → → →
  8. 8. • 2 • JDK11 with JShell(120 ) • (45 ) https://qiita.com/nowokay/items/80e8ccd50f6749846dd6
  9. 9. GraalVM • Oracle JVM • http://www.graalvm.org/ • Graal + Truffle • Polyglot • JS, Python, Ruby, … •
  10. 10. GraalVM and MicroProfile: A Polyglot Microservices Solution [DEV6016]
  11. 11. Graal • Java JIT • C2 Client(C1) Server(C2) Compiler Interface HotSpot Graal JVMCI HotSpot Written in Java
  12. 12. Truffle Sulong • Truffle • • AST GC • LLVM • Sulong • LLVM bitcode -> Truffle AST • LLVM • Rust, Swift, C…
  13. 13. Polyglot • Truffle • JavaScript(Graal JS), Ruby(TruffleRuby), Python, R… • • • Oracle MySQL SQL JavaScript
  14. 14. • Java • SubstrateVM Instant Startup and Low Footprint for Java [DEV5705]
  15. 15. GraalVM in Oracle Code One 2018 • graal 10 • Vision and Roadmap • GraalVM JavaScript vue ( )
  16. 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. 17. VM • JIT • Also available with JDK11 java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMXCICompiler Hello • Oracle Code One
  18. 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. 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. 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. 21. LLVM • Rust $ rustc --emit=llvm-bc main.rs $ lli --lib $(rustc --print sysroot)/lib/libstd-* main.bc
  22. 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
  23. 23. • GraalVM

×