Presentation is loading. Please wait.

Presentation is loading. Please wait.

GraalVM Scott Lynn Director of Product Strategy, Oracle Linux

Similar presentations


Presentation on theme: "GraalVM Scott Lynn Director of Product Strategy, Oracle Linux"— Presentation transcript:

1

2 GraalVM Scott Lynn Director of Product Strategy, Oracle Linux
Confidential – Oracle Internal/Restricted/Highly Restricted

3 This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.

4 You need to execute strategy faster and respond faster to customer and business needs
Budgetary cuts mean you need to drive productivity up and drive down costs In the face of nearly constant change, you have ever increasing security and compliance requirements Agile World

5 Capital Expense to Subscription
Private Data Centers & Web IOT Machine Learning/AI Cloud Shifting from a capital expense model to subscription model <click> Private Data Centers and Client/Web-based apps to IOT & Cloud It’s allows dynamic data centers. No longer have to build a data center to meet your anticipated maximum usage. You buy what you need, when you need it. This is reducing hardware, power, cooling, and real estate costs. It allows to execute strategy faster and respond faster to customer and business needs You are able to drive productivity up and drive down costs in the face of ever shrinking budgets

6 Plethora of Languages

7 Use Different Languages for Different Jobs
Long tail of programming languages You run more than a few languages Even cloud businesses like Twitter have “legacy” code Right tool for the Job: R or Python for data science Ruby or JavaScript for front ends Java or C/C++ for server back ends They moved their backend from Ruby to Scala for better latency & throughput They still use Ruby for front-end as it is faster for them to iterate

8 Cloud software is demanding more efficient runtimes
Move from VMs to containers allows more sharing between apps (e.g. the OS) * Source: ZDNet.com: “What is Docker and why is it so darn popular?”, May 7, 2017

9 Host Operating System & Container Virtualization
Apps in Containers Language Runtimes Are Generally Pretty Big “Hello World” in Java: 24 MB “Hello World” in JavaScript (V8): 18 MB “Hello World” in Ruby/Rails: 8 MB App A1 Java VM Java Libs JBoss App B1 App C1 App D2 App A2 App A3 App B2 App D1 Ruby Ruby Libs Rails Python Python Libs JavaScript JS Libs Node.js Host Operating System & Container Virtualization

10 Host Operating System & Container Virtualization
The Same Services Why Not Just Share them? GC Coupling Don’t run in JavaVM or not well Interpreter JIT Compiler Garbage Collector All applications need such services, so why can’t I share such them across different applications? Java application servers (like JBoss or WebLogic) did this, but they have a few problems The biggest issue is “GC Coupling”: if multiple applications share a heap, and if one of them triggers a garbage collection, it can stop the other applications in that runtime Very bad for most multitenant scenarios The second issue was that a lot of applications don’t run on the Java VM (or at least not very well), so they don’t solve the multitenant app problem as well as Docker does App A1 Java VM Java Libs JBoss App B1 App C1 App D2 App A2 App A3 App B2 App D1 Ruby Ruby Libs Rails Python Python Libs JavaScript JS Libs Node.js Host Operating System & Container Virtualization Memory Manager Ruby Ruby Libs Rails Code Cache Threading / Scheduler Network Access Filesystem Access

11 GraalVM

12 GraalVM is Polyglot (Multilingual) Virtualization
Graal languages are built on the “Truffle” API for constructing interpreters Interpreters define the semantics of the language, and are also used to profile program behavior to guide compilation of frequently-used code (e.g. loops) Truffle is a Java API GraalVM includes multiple language interpreters, and learns the type system and language from what they do in order to generate the compiler Since the interpreters are all implemented in Java, merging them together into a single engine looks the same to Graal as a single (very complicated) language Graal watches Truffle API activity to learn the language Compiled code snippet JavaScript Interpreter Ruby Interpreter R Interpreter Python Interpreter Compiled code snippet GraalVM compiler Compiled code snippet Compiled code snippet Compiled code snippet Compiled code snippet Truffle API Java Runtime

13 Complete GraalVM architecture
Easy! Right? JavaScript application JavaScript libraries Node.js Ruby application Ruby gems & libraries Rails Compiled code snippet JavaScript Interpreter Ruby Interpreter R Interpreter Python Interpreter Compiled code snippet GraalVM compiler Compiled code snippet Compiled code snippet Compiled code snippet Compiled code snippet Truffle API Java Runtime

14 Complete GraalVM architecture
Doesn’t this break security? What do you do about native code? JavaScript application JavaScript libraries Node.js Ruby application Ruby gems & libraries Rails Compiled code snippet JavaScript Interpreter Ruby Interpreter R Interpreter Python Interpreter Compiled code snippet GraalVM compiler Compiled code snippet Compiled code snippet Compiled code snippet Compiled code snippet Truffle API Java Runtime

15 Complete GraalVM architecture
JavaScript application JavaScript libraries Node.js Ruby application Ruby gems & libraries Rails R native libraries Node.js native libs Ruby/Rails native libs Compiled code snippet JavaScript Interpreter Ruby Interpreter R Interpreter Python Interpreter LLVM .bc Interpreter Compiled code snippet GraalVM compiler Compiled code snippet Compiled code snippet Compiled code snippet Compiled code snippet Truffle API Java Runtime 15

16 Complete GraalVM architecture
JavaScript application Ruby application R native libraries Node.js native libs Ruby/Rails native libs When GraalVM is embedded in the HotSpot JVM, you can run Java apps directly on the JVM without Truffle In this case, JVM uses Graal as a Java bytecode compiler via the JVM Compiler Interface (JVMCI, or JEP 243) Note: Truffle gives an “Abstract Syntax Tree” (language-agnostic representation of work to do) to Graal, not Java bytecodes JavaScript libraries Ruby gems & libraries eval("application/x-ruby", "def add(a, b) a + b; end;"); Node.js Rails Truffle Polyglot API JavaScript Interpreter Ruby Interpreter R Interpreter LLVM .bc Interpreter Compiled code snippet Compiled code snippet Truffle API Java application Compiled code snippet Graal compiler Truffle CI Compiled code snippet Compiled code snippet JavaVM Runtime Compiled code snippet JVMCI Threads / Scheduler Filesystem Network GC / heap Code cache

17 GraalVM embedded in the Oracle Database
Embedding GraalVM allows substitution of the underlying engine’s service layer JavaScript application Ruby application R native libraries Node.js native libs Ruby/Rails native libs Oracle database takes on many functions of an OS: scheduling, resource management, I/O GraalVM allows mixing & matching system components from the underlying runtime JavaScript libraries Ruby gems & libraries eval("application/x-ruby", "def add(a, b) a + b; end;"); Node.js Rails Truffle Polyglot API JavaScript Interpreter Ruby Interpreter R Interpreter LLVM .bc Interpreter Compiled code snippet Compiled code snippet Truffle API Compiled code snippet Graal compiler Truffle CI Compiled code snippet Compiled code snippet GraalVM Runtime GC / heap Code cache Compiled code snippet Oracle RDBMS Runtime Net Filesystem Threads / Scheduler

18 Host Operating System & Container Virtualization
Apps in Containers Language Runtimes Are Generally Pretty Big “Hello World” in Java: 24 MB “Hello World” in JavaScript (V8): 18 MB “Hello World” in Ruby/Rails: 8 MB App A1 App A2 App A3 App B1 App B2 App D1 App D2 Java VM Java Libs JBoss Java VM Java Libs JBoss Java VM Java Libs JBoss Ruby Ruby Libs Rails Ruby Ruby Libs Rails JavaScript JS Libs Node.js JavaScript JS Libs Node.js App C1 Python Python Libs Host Operating System & Container Virtualization

19 Apps in Containers with Graal
Shared runtime Memory management Separate spaces for apps called ”Isolates” Scheduling Code Higher performance applications Higher server density App D1 App D2 App C1 JS Libs App B1 App B2 Python Libs Ruby Libs Node.js Rails Python Interpreter JavaScript Interpreter Ruby Interpreter Truffle API App A1 App A2 App A3 Java Runtime Host Operating System & Container Virtualization

20 Graal Performance Comparison vs the state of the art special-purpose implementation Average across a wide range of benchmarks Some kinds of code (e.g. code with lots of allocations & GC, network/file access) will not be improved More abstract & complex code has more opportunities for improved analysis and sees larger benefits Range Speedup (Geomean) Comparison Versus Java 0.8x - 2x 1.1x JDK8 Scala 1.3x JavaScript 0.5x 1.5x 1.05x Google V8 Ruby 1x 100x 5x JRuby R GNU R C/C++ 0.4x 1.2x 0.9x LLVM native

21 Application Level Performance
What about real applications, not just benchmarks According to Twitter, Graal runs Twitter 25% faster than Java8 WebLogic Server has 10% better throughput running basic web pages

22 Polyglot Demo

23 Stream Demo

24 Learn More or Get Involved
GraalVM at Oracle GraalVM at Git

25 Q&A Confidential – Oracle Internal/Restricted/Highly Restricted

26 This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.

27

28


Download ppt "GraalVM Scott Lynn Director of Product Strategy, Oracle Linux"

Similar presentations


Ads by Google