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.

Cloud Native Java GraalVM 이상과 현실

1,396 views

Published on

SpringCamp 2019에서 발표했던 GraalVM 문서입니다. GraalVM 3대 특징이 고속 JIT Compiler, Native Image, Language Virtualization을 소개합니다.

Published in: Engineering
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ..................................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Cloud Native Java GraalVM 이상과 현실

  1. 1. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted Cloud Native Java: GraalVM 이상과 현실 김태완(taewanme@gmail.com) Oracle Korea Solution Engineering @taewanme, http://taewan.kim
  2. 2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 자바 다양성 시대 Confidential – Oracle Internal/Restricted/Highly Restricted 2
  3. 3. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Confidential – Oracle Internal/Restricted/Highly Restricted 3 http://www.graalvm.org/
  4. 4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Why GraalVM? Confidential – Oracle Internal/Restricted/Highly Restricted 4 8. Java code as a native library 1. High-performance modern Java 2. Low-footprint, fast-startup Java 3. Combine JavaScript, Java, Ruby, and R 4. Run native languages on the JVM 5. Tools that work across all languages 6. Extend a JVM-based application 7. Extend a native application 9. Polyglot in the database 10. Create your own languagehttps://chrisseaton.com/truffleruby/tenthings/
  5. 5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Why GraalVM? Confidential – Oracle Internal/Restricted/Highly Restricted 5 8. Java code as a native library 1. High-performance modern Java 2. Low-footprint, fast-startup Java 3. Combine JavaScript, Java, Ruby, and R 4. Run native languages on the JVM 5. Tools that work across all languages 6. Extend a JVM-based application 7. Extend a native application 9. Polyglot in the database 10. Create your own language
  6. 6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Why GraalVM? Confidential – Oracle Internal/Restricted/Highly Restricted 6 8. Java code as a native library 1. High-performance modern Java 2. Low-footprint, fast-startup Java 3. Combine JavaScript, Java, Ruby, and R 4. Run native languages on the JVM 5. Tools that work across all languages 6. Extend a JVM-based application 7. Extend a native application 9. Polyglot in the database 10. Create your own language IoT Polyglot Cloud Native
  7. 7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Why GraalVM? Confidential – Oracle Internal/Restricted/Highly Restricted 7 8. Java code as a native library 1. High-performance modern Java 2. Low-footprint, fast-startup Java 3. Combine JavaScript, Java, Ruby, and R 4. Run native languages on the JVM 5. Tools that work across all languages 6. Extend a JVM-based application 7. Extend a native application 9. Polyglot in the database 10. Create your own language IoT Polyglot Cloud Native
  8. 8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Why GraalVMè Native Application Confidential – Oracle Internal/Restricted/Highly Restricted 8 8. Java code as a native library 1. High-performance modern Java 2. Low-footprint, fast-startup Java 3. Combine JavaScript, Java, Ruby, and R 4. Run native languages on the JVM 5. Tools that work across all languages 6. Extend a JVM-based application 7. Extend a native application 9. Polyglot in the database 10. Create your own language IoT Polyglot Cloud Native
  9. 9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 9
  10. 10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 10 https://medium.com/graalvm/instant-netty-startup-using- graalvm-native-image-generation-ed6f14ff7692
  11. 11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Team Confidential – Oracle Internal/Restricted/Highly Restricted 11
  12. 12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM 개발 팀: Research Confidential – Oracle Internal/Restricted/Highly Restricted 12 64편 이상 논문(2012 ~ 2019) https://www.graalvm.org/community/publications/
  13. 13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Confidential – Oracle Internal/Restricted/Highly Restricted 13 8 + +
  14. 14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | dk Confidential – Oracle Internal/Restricted/Highly Restricted 14
  15. 15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 15 JIT Compiler
  16. 16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Write Once, Run Anywhere Confidential – Oracle Internal/Restricted/Highly Restricted 16 이미지 출처: https://commons.wikimedia.org/wiki/File:Java-program-execution.png - javac compiler - Java code(String) è byte[] - java Binary Representation - compact & small - JIT compiler - byte[] è byte[] (machine code) - compact & small representation
  17. 17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Compiler Confidential – Oracle Internal/Restricted/Highly Restricted 17 • AOT(Ahead-of-Time) Compiler • JIT (Just-In-Time) Compiler Static vs Dynamic Compiler
  18. 18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | AOT 컴파일러와 Dynamic 컴파일러 공통점 Confidential – Oracle Internal/Restricted/Highly Restricted 18 AOT Compiler JIT Compiler è Machine Code è Machine Code
  19. 19. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | AOT 컴파일러와 Dynamic 컴파일러 차이점 Confidential – Oracle Internal/Restricted/Highly Restricted 19 AOT Compiler JIT Compiler Source code → Native executable Source code → Bytecode → Interpreter + JIT executable 실행전에 무겁고 복잡한 분석&최적화 수행 실행 환경 정보 수집 어려움 Static Code 최적화 공격적이고 낙관적인 최적화 실행 프로파일 정보를 활용 특정 환경 특화된 최적화
  20. 20. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | JIT Compiler의 목표 빠른 컴파일 속도 & 최적화 Confidential – Oracle Internal/Restricted/Highly Restricted 20
  21. 21. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | JIT Compiler • Speculation Without Regret: Reducing Deoptimization Meta-data in the Graal compiler Confidential – Oracle Internal/Restricted/Highly Restricted 21 http://ssw.jku.at/General/Staff/GD/PPPJ-2014-duboscq-29.pdf JVM
  22. 22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | HotSpot Optimization Confidential – Oracle Internal/Restricted/Highly Restricted 22
  23. 23. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Optimization: inlining Confidential – Oracle Internal/Restricted/Highly Restricted 23 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;} int addAll(int max){ int accum = 0; for(int i = 0; i<max; i++) { accum = accum + i; } return accum; } Optimization: inlining
  24. 24. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | JVM 성능 향상 Confidential – Oracle Internal/Restricted/Highly Restricted 24 http://www.dominicgiles.com/blog/files/abdb7a96e9db63644317c62d6e40c40b-142.html
  25. 25. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | JVM 성능 향상 주체 • JIT Compiler – Profiling & • CPU, Memory, Object Tracking, Mem – Optimization • 더 효율적인 코디 패턴 감지 • 더 효율적인 머신 코드 생성 Confidential – Oracle Internal/Restricted/Highly Restricted 25 http://ssw.jku.at/General/Staff/GD/PPPJ-2014-duboscq-29.pdf
  26. 26. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Intel CPU의 Java 최적화 Confidential – Oracle Internal/Restricted/Highly Restricted 26
  27. 27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 27 HotSpot
  28. 28. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | HotSpot • Oracle Java JVM • Java SE 1.3(1999. 04)에 추가 • 개발 언어: C++ • 2개의 JIT compiler를 포함 – C1: client compiler • C1 디자인: 빠른 시작 • 코드 최적화의 비중 낮춤 – C2: server compiler • C2 디자인: 약간 느린 시작 • 코드 최적화 비중 높임 Confidential – Oracle Internal/Restricted/Highly Restricted 28 HotSpot VM C1 C2 Compiler Interface HotSpot VM c++ c++ c++ c++
  29. 29. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | JVM Confidential – Oracle Internal/Restricted/Highly Restricted 29
  30. 30. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | HotSpot 의 고민 Confidential – Oracle Internal/Restricted/Highly Restricted 30
  31. 31. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | HotSpot – Limitation Confidential – Oracle Internal/Restricted/Highly Restricted 31 https://github.com/netroby/jdk9- dev/blob/master/jdk/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java
  32. 32. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 32 GraalVM & Graal
  33. 33. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Confidential – Oracle Internal/Restricted/Highly Restricted 33 8 + +
  34. 34. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 34
  35. 35. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 35
  36. 36. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Team Confidential – Oracle Internal/Restricted/Highly Restricted 36
  37. 37. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM의 핵심 키워드 Confidential – Oracle Internal/Restricted/Highly Restricted 37 Graal / JVMCI Polyglot/ Truffle Native Image NEW JIT Complier Language Platform AOT Compiler
  38. 38. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Graal != GraalVM Confidential – Oracle Internal/Restricted/Highly Restricted 38 HotSpot VM C1 C2 Compiler Interface OpenJDK 8 HotSpot VM Compiler Interface JVMCI C1 Graal GraalVM
  39. 39. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Graal • GraalVM의 새로운 JIT Compiler • Hotspot의 C2 JIT 컴파일러 대체가 목표 • Java로 개발 • C2와 비교하여 20% 선능 개선 (Twitter 사례) – Production Scala 애플리케이션에 적용 – GraalVM CE(Community Edition) Confidential – Oracle Internal/Restricted/Highly Restricted 39 https://www.youtube.com/watch?v=ZbccuoaLChk
  40. 40. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Community Edition • Free • Unsupported • Runs all GraalVM languages – Java (+Scala), JavaScript, Python, Ruby, R • Support for native libraries in context of those languages too – Tools (debugger, profiler, monitor agent) • Basic version of SubstrateVM – Native code has full access to address space • Runs code in JVM, Node.js, MySQL, or standalone Enterprise Edition • Not Free • Supported • Best performance & size – Graal EE Java is 20% faster than CE (on average) – Dynamic languages (JS, Python, R, Ruby) 2x faster – Smallest footprint – 2x smaller vs CE • Native code memory protection • Debugging tools for embedded use Confidential – Oracle Internal/Restricted/Highly Restricted 40 GraalVM 라이센스
  41. 41. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Scala 2.12.6 & GraalVM Confidential – Oracle Internal/Restricted/Highly Restricted 41 https://medium.com/graalvm/compiling-scala-faster-with-graalvm-86c5c0857fa3
  42. 42. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | graal compiler • OpenJDK 9 + • OpenJDK 10 + • OpenJDK 11 + • GraalVM Confidential – Oracle Internal/Restricted/Highly Restricted 42 -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+EnableJVMCI
  43. 43. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | graal compiler Confidential – Oracle Internal/Restricted/Highly Restricted 43 https://www.graalvm.org/docs/examples/java-performance-examples/ https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e01
  44. 44. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | graal compiler Demo Confidential – Oracle Internal/Restricted/Highly Restricted 44 OpenJDK 11, Tiered Compiler OpenJDK 11, Graal Compiler https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e01
  45. 45. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | graal compiler 결과 Confidential – Oracle Internal/Restricted/Highly Restricted 45
  46. 46. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | graal compiler Demo: compile log Confidential – Oracle Internal/Restricted/Highly Restricted 46 https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e01
  47. 47. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Graal과 Twitter Confidential – Oracle Internal/Restricted/Highly Restricted 47 https://www.youtube.com/watch?v=G-vlQaPMAxg
  48. 48. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM 기능과 JEP • JEP: JDK Enhancement Proposal Confidential – Oracle Internal/Restricted/Highly Restricted 48
  49. 49. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 49 Native Image
  50. 50. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Native Runtime Confidential – Oracle Internal/Restricted/Highly Restricted 50 Java Java or node.js or R or Ruby or Python or C/C++ User Function SVM dynamically executed native precompiled Graal VM on SubstrateVM Java Java or node.js or R or Ruby or Python or C/C++ User Function HotSpot dynamically executed native precompiled Graal VM on HotSpot
  51. 51. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Native Image Confidential – Oracle Internal/Restricted/Highly Restricted 51
  52. 52. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 작은 footprint, 신속한 startup Confidential – Oracle Internal/Restricted/Highly Restricted 52 OpenJDK 11, Graal Compiler SubstrateVM (SVM) • GraalVM의 하위 프로젝트 • JVM 애플리케이션을 컴파일하여 Native 실행파일을 생성 • Ahead-of-time compiler- 빠른 시작을 유도 • Virtual 머신이 필요 없음 • 작은 메모리로 시작 • 38Mbyte virt.x 애플리케이션을 10MB RAM에서 돌린 사례 • https://www.jetdrone.xyz/2018/08/10/Vertx-native-image- 10mb.html
  53. 53. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Native Image Demo Confidential – Oracle Internal/Restricted/Highly Restricted 53
  54. 54. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Graal & SubstrateVM Confidential – Oracle Internal/Restricted/Highly Restricted 54
  55. 55. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 빠른 Startup: Heap Image • d Confidential – Oracle Internal/Restricted/Highly Restricted 55 https://medium.com/graalvm/isolates-and-compressed-references-more-flexible-and- efficient-memory-management-for-graalvm-a044cc50b67e
  56. 56. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Substrate VM Java Limitations Confidential – Oracle Internal/Restricted/Highly Restricted 56 https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md 항목 지원 Dynamic Class Loading / Unloading Not supported Reflection Mostly supported Dynamic Proxy Mostly supported Java Native Interface (JNI) Mostly supported Unsafe Memory Access Mostly supported Static Initializers Partially supported InvokeDynamic Bytecode and Method Handles Not supported Finalizers Not supported References Mostly supported Security Manager Not supported JVMTI, JMX, other native VM interfaces Not supported
  57. 57. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Micronaut의 GraalVM 지원 Confidential – Oracle Internal/Restricted/Highly Restricted 57
  58. 58. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Micronaut의 GraalVM 지원 Confidential – Oracle Internal/Restricted/Highly Restricted 58
  59. 59. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Micronaut의 GraalVM 지원 Confidential – Oracle Internal/Restricted/Highly Restricted 59
  60. 60. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM 기능과 JEP Confidential – Oracle Internal/Restricted/Highly Restricted 60
  61. 61. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 61 Polyglot
  62. 62. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Truffle Confidential – Oracle Internal/Restricted/Highly Restricted 62
  63. 63. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Polyglot Virtualization 63 Truffle API JavaVM Runtime JavaScript Interpreter Ruby Interpreter R Interprete r Graal compiler Compiled code snippetCompiled code snippetCompiled code snippetCompiled code snippetCompiled code snippetCompiled code snippet JavaScript application JavaScript libraries Node.js … Ruby application Ruby gems & libraries Rails LLVM .bc Interpreter R native libraries Node.js native libs Ruby/Rails native libs Threads / Scheduler Filesystem Network GC / heap Code cache Java application Truffle Polyglot API eval("application/x-ruby", "def add(a, b) a + b; end;");
  64. 64. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Ecosystem Confidential – Oracle Internal/Restricted/Highly Restricted 64
  65. 65. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Ployglot Performance Confidential – Oracle Internal/Restricted/Highly Restricted 65
  66. 66. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM Language Status Available 2017 Available 2018 Proposed / Prototyping Confidential – Oracle Internal/Restricted/Highly Restricted 66 Java C C++ Python C# VB.NET JavaScript Assembly language PHP PerlRubyVBSwift R Objective-C Go MATLAB Delphi/Object Pascal PL/SQL Scratch Others PROGRAMMING LANGUAGE POPULARITY (TOP 20 LANGUAGES FROM MAY 2017 TIOBE INDEX) Groovy FORTRAN Kotlin Clojure Scala F#
  67. 67. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Java에서 다른 언어 호출 Confidential – Oracle Internal/Restricted/Highly Restricted 67 import org.graalvm.polyglot.*; public class Sample { public static void main(String[] args) { try (Context context = Context.newBuilder().allowAllAccess(true).build()){ System.out.println( context.getEngine().getLanguages().keySet()); context.eval("ruby", "puts '안녕, 루비’”); context.eval("python", "print(안녕, 파이썬')"); context.eval("js", "console.log(‘안녕, JS')"); context.eval("R", "cat(‘안녕, R')"); } catch (PolyglotException e) { e.printStackTrace(); } } } https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e04
  68. 68. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | spring-r: mvn spring-boot:run Confidential – Oracle Internal/Restricted/Highly Restricted 68 https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e06
  69. 69. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Spring-r UI: http://localhost:8080/load Confidential – Oracle Internal/Restricted/Highly Restricted 69 https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e06
  70. 70. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Java에서 다른 언어를 호출 (LLVM) Confidential – Oracle Internal/Restricted/Highly Restricted 70 #include <stdio.h> int main(){ print(“Hello from graalvm!n”); return 0; } $ clang -c -O1 -emit-llvm hello.c $ lli hello.bc Hello from graalvm! $ https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e03
  71. 71. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Java에서 다른 언어를 호출 (LLVM) Confidential – Oracle Internal/Restricted/Highly Restricted 71 import org.graalvm.polyglot.*; import java.io.*; public class Sample { public static void main(String[] args) throws Exception { File f = new File("hello.bc"); Source source = Source.newBuilder("llvm", new File("hello.bc")).build(); try (Context context = Context.newBuilder().allowAllAccess(true).build()){ context.eval(source).execute(); } } } https://github.com/taewanme/graalvm_seminar_examples/tree/master/examples/e03
  72. 72. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 72 https://github.com/taewanme/graalvm_seminar_examples
  73. 73. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 73 GraalVM 현재
  74. 74. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 74
  75. 75. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 75
  76. 76. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 76
  77. 77. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 77
  78. 78. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 78 GraalVM 사례
  79. 79. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 79 Twitter https://www.youtube.com/watch?v=PtgKmzgIh4c • Twitter VM 팀은 Graal 컴파일러를 사용하여 Scala 기반 microservices 운영 • 메모리 할당과 성능 향상 • 성능 개선: 20%
  80. 80. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 80 Goldman Sachs https://www.youtube.com/watch?time_continue=417&v=MUECwHdr07Q
  81. 81. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 81 GraalVM Summary
  82. 82. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM의 목표: Six degrees of freedom Confidential – Oracle Internal/Restricted/Highly Restricted 82 https://commons.wikimedia.org/wiki/File:6DOF.svg • Fast Startup Java Application: Native • High Performance Java Application • Integrated Polyglot Application • Java as Language Platform • Embedded Java Application
  83. 83. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GraalVM, OpenJDK, Oracle Java Confidential – Oracle Internal/Restricted/Highly Restricted 83 Graal Native Image JVMCI JEP 243: Java-Level JVM Compiler Interface JEP 295: Ahead-of-Time Compilation JEP 317: Experimental Java-Based JIT Compiler 9 ~ 12 8
  84. 84. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 추가 자료 Confidential – Oracle Internal/Restricted/Highly Restricted 84 • http://taewan.kim/post/graalvm_seminar/ 발표 동영상
  85. 85. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 추가 자료 Confidential – Oracle Internal/Restricted/Highly Restricted 85 • https://github.com/taewanme/graalvm_seminar_examples
  86. 86. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 추가자료 Confidential – Oracle Internal/Restricted/Highly Restricted 86 gitter.im/graalvm
  87. 87. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 87

×