How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - June 2020)

Lucas Jellema
Lucas JellemaCTO at AMIS
How and why
GraalVM is
quickly becoming
relevant for you
ACEs@home | How and why GraalVM is quickly becoming relevant for you
ACEs@home – 17th June 2020
Lucas Jellema, CTO & Architect AMIS, Oracle ACE Director & Groundbreaker Ambassador
Demo
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Demo
ACEs@home | How and why GraalVM is quickly becoming relevant for you
bit.ly/graalvm-handson
GraalVM
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Custom DSL
Oh boy, we will be in so much trouble…
ACEs@home | How and why GraalVM is quickly becoming relevant for you
What is GraalVM?
ACEs@home | How and why GraalVM is quickly becoming relevant for you
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Performance and Resource Consumption of GraalVM vs C2
What is GraalVM - beyond a better JIT compiler?
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Native
Image
Custom
DSL
Polyglot
Tools
Introducing
• JIT Compiler for running Java applications faster
(matching native languages for speed)
• Embeddable on Hotspot VM or other JVMs
• Polyglot VM – for running applications in any language
• JavaScript, Ruby, R, Python, C/C++
• Ahead-of-Time compiler for creating native binaries
• Simple, lean runtime with fast startup and minimal
memory and process footprint
• Interoperability platform that allows applications in one
technology to interact with with modules in other
technologies (“Nashorn on super steroids”)
• Framework for compiling, running, interoperating and
natively compiling applications written in your own DSL
• Set of cross-language programming tools
ACEs@home | How and why GraalVM is quickly becoming relevant for you
(limited) Spring Boot
support for GraalVM
native images
2017
Some history on GraalVM
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Project spun off from
Maxine VM
2012
Proof of Concept: a compiler written in Java (with all its
software engineering advantages) could generate highly
optimized code without compromising on compile times
2019
Twitter started to run its
many Scala applications
on the GraalVM JIT
Compiler to save money
and CPU cycles
20.1.0
May, 2020
WebLogic
Certified on
GraalVM
GraalVM
“productized”
at Oracle
ES2020
support
GraalVM
Advisory
Board
Spring Framework
5.3 with GraalVM
AOT support
WebAssembly
support
Oracle
Database
MLE
GraalVM support in
Helidon, Micronaut &
Quarkus
Coherence
support for
GraalVM
Project Fn
GraalVM
enabled
Java 11
support
GraalVM:
Two Editions
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM EE included
in all OCI subscriptions
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM Enterprise is included in all Oracle Cloud
Infrastructure (OCI) subscriptions so you can use it for
no additional charge (Compute, OKE, Functions)
Today, we will focus on
• JIT Compiler for running Java applications faster (matching native
languages)
• on Hotspot VM or other traditional VMs
• Polyglot VM – for running applications in any language
• JavaScript, Ruby, R, Python, C/C++
• Ahead-of-Time compiler for creating native binaries
• Simple, lean runtime with fast startup and minimal memory and
process footprint
• Interoperability platform that allows applications in one technology to
interact with with modules in other technologies (“Nashorn on super
steroids”)
• Framework for compiling, running, interoperating and natively compiling
applications written in your own DSL
• Set of cross-language programming tools
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM:
Polyglot Runtime
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Polyglot Run Time
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Why do we have so many languages?
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Polyglots – speak and understand many languages
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM Polyglot Runtime
• GraalVM can run (on the mature, manageable, observable and run time optimized
JVM)
• Java
• JVM Languages
• Many other languages
• Through Truffle produced intermediate code
• Including Static Languages through Sulong- an LLVM IR interpreter
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Fortran
Haskell
Truffle
Your own
Custom DSL
GraalVM:
Ahead-of-Time compiler
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM compile modes
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM compile modes
ACEs@home | How and why GraalVM is quickly becoming relevant for you
JIT
java MyMainClass
GraalVM compile modes
ACEs@home | How and why GraalVM is quickly becoming relevant for you
JIT
java MyMainClass
AOT
native-image MyMainClass
./mymainclass
Ahead-of-Time Compilation
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Application
Substrate VM
JDK
Libraries
All Java classes from
your application, JDK
and Substrate VM
Points-
to analysis
Run
initializations
Heap
snapshotting
Iterative analysis on all
reachable methods,
fields and classes
Machine Code
Image Heap
Native executable
Application running without
dependency on JDK
Input Analysis Output
AOT vs JIT: Startup Time
JIT
• Load JVM executable
• Load the classes from the file system
• Verify bytecode
• Start interpreting
• Run static initializers
• First tier compilation (C1)
• Run (suboptimal)
• Gather profiling feedback
• Second tier compilation (GraalVM or C2)
• Run with best machine code
AOT
• Load executable with prepared heap
• Immediately start with best machine code
ACEs@home | How and why GraalVM is quickly becoming relevant for you
AOT vs JIT: Memory Footprint
JIT
• Loaded JVM executable
• Application data
• Loaded bytecodes
• Reflection meta-data
• Code cache
• Profiling data
• JIT compiler data structures
AOT
• Loaded application executable
• Application data
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Microservices – Serverless – Containers
ACEs@home | How and why GraalVM is quickly becoming relevant for you
AOT vs JIT
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Frameworks adopting native image
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Helidon SE (Oracle)
A set of Java Libraries for writing microservices
Micronaut
JVM-based framework for building light-weight
modular applications (microservices)
Quarkus (Red Hat)
Kubernetes-native Java framework tailored for
GraalVM and Hotspot
Polyglot Platform with Language
Interoperability
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Polyglot Interoperability
• Establish frictionless interaction between language contexts
• To benefit from the best of all wor(l)ds
ACEs@home | How and why GraalVM is quickly becoming relevant for you
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Polyglot Interoperability
• Establish frictionless interaction between language contexts
• To benefit from the best of all wor(l)ds
• Call out to ‘other world’ in a native way
• Receive response in interpretable format
• Minimal hoops to jump through at design time
• Minimal performance overhead at run time
• Uncomplicated run time environment
• Despite multiple runtime execution languages
• Basically: polyglot with the ease of mono-glot
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Current interoperability on JVM
• Current interoperability options from Java:
• file or queue based interaction
• REST API
• native interfaces (such as Java JNI and JNA)
• JSR-223 Interoperability - for example Nashorn
(and support for many other scripting languages);
• intra-JVM, Java Byte code level interop between
Java/Groovy/Kotlin/JRuby/Jython
• Less than perfect: complex, suboptimal performance,
technical limitations, variations in approach,
complex runtime environments, complex testing
ACEs@home | How and why GraalVM is quickly becoming relevant for you
All languages are used to express and communicate very
similar concepts
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Meta Language
(concepts, grammar,
structure)
All programming languages are used to express and execute
very similar concepts
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Abstract Syntax Tree
(variables, loops, conditions,
calls, arithmetic)
GraalVM can merge and run (Java Byte) code
derived from various origins
• GraalVM provides generic objects
in all supported languages to make
Polyglot call-outs, evaluate embedded
foreign code and share data across
language contexts
• Thus enabling interoperability
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM
Polyglot
Fortran
Haskell
The New Beast between Java and JavaScript
• Out go Rhino and Nashorn
• In comes GraalVM
ACEs@home | How and why GraalVM is quickly becoming relevant for you
From Java to JavaScript
• Evaluate JS snippets
• Load and call JavaScript sources
• Exchange data and objects back and forth
• Allow JavaScript to callback to Java objects
• Run multiple JavaScript threads in parallel
• Note: what applies to JavaScript by and large applies to all languages that
can run on GraalVM through Truffle
• Including Python, R, Ruby, LLVM (C/C++, Rust, Swift,…)
• Your own DSL
ACEs@home | How and why GraalVM is quickly becoming relevant for you
From Java to JavaScript
Evaluate a Simple Code Snippet
ACEs@home | How and why GraalVM is quickly becoming relevant for youJFall 2019 - HOW AND WHY GRAALVM
Create Polyglot
context
Evaluate
Snippet
Import Graal
Polyglot package
From Java to JavaScript
Evaluate a Simple Code Snippet
ACEs@home | How and why GraalVM is quickly becoming relevant for youJFall 2019 - HOW AND WHY GRAALVM
Create Polyglot
context
Evaluate
Snippet
Evaluate Snippet =>
instantiate function
Execute function
Import Graal
Polyglot package
From Java to JavaScript
Evaluate a Simple Code Snippet
ACEs@home | How and why GraalVM is quickly becoming relevant for youJFall 2019 - HOW AND WHY GRAALVM
Create Polyglot
context
Evaluate
Snippet
Evaluate Snippet =>
instantiate function
Execute function
Handle Exception
from JS
Import Graal
Polyglot package
A Typical Java Challenge
(aided by JavaScript interaction)
• Developing a Java application
• I need to perform validations on input data
• Postal Code (various countries), Mobile Phone Numbers (many
countries), Email Address, Credit Card Number etc.
• NPM Module Validator offers
most of these OOTB
• But… it is written in JavaScript
• How does that help me?
ACEs@home | How and why GraalVM is quickly becoming relevant for you
A Typical Java Challenge
• Developing a Java application
• I need to perform validations on input data
• Postal Code (various countries), Mobile Phone Numbers (many
countries), Email Address, Credit Card Number etc.
• In Pseudo Code:
•
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Community package in JavaScript for dozens of predefined
validations
ACEs@home | How and why GraalVM is quickly becoming relevant for you
JavaScript Validator Module is compatible with GraalJS
ACEs@home | How and why GraalVM is quickly becoming relevant for you
A Typical Java Challenge – Resolved (with GraalVM)
• Embrace GraalVM as the Java runtime
• Install npm module validator
• Install and use webpack
to create a single bundle for module validator
• Extend Java application
• Import GraalVM Polyglot package
• Create JavaScript Context
• Load validator_bundled.js into context
• Get desired JS functions from bindings map
• Execute required JS functions
as if they were Java methods
ACEs@home | How and why GraalVM is quickly becoming relevant for you
A Typical Java Challenge – Resolved (with GraalVM)
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Polyglot and Ahead of Time Compiled Native Binary
• A multi-lingual or polyglot Java application can be turned into a Native
Binary Executable using GraalVM Ahead of Time compilation
• Non JVM-languages can be included but are not compiled ahead of time
• The build process for the binary executable takes long & uses a lot of memory
• The outcome: a single, smal[lish] file running on plain Linux
with fast startup & low memory footprint
• For example in Alpine Linux Container or in Linux Binary Serverless Function
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM
Polyglot
Fortran
Haskell
GraalVM
Native Image
(binary executable)
application
Polyglot
from Node | Python | Ruby | R| …
to any language on GraalVM
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Polyglot from non-JVM languages
• Any language running on GraalVM
can participate in Polyglot interoperability
• Evaluate & Execute Snippets in other languages
• Export data and objects through the Polyglot Map
to other execution contexts
• Import data and objects from
the Polyglot Map from other
language contexts
• Read, write & execute
• Interacting with JVM based
languages is slightly different
• Use Java Type to construct native
object based on a Java Class
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM
Polyglot
Fortran
Haskell
Polyglot from non-JVM languages
Dutch National Police Case: Scala  (Fast)R on GraalVM
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM
Polyglot
Polyglot from JavaScript to other Graal Truffle Languages
• Polyglot.eval can execute any language snippet
• It returns data objects (to read/write) or functions (that can be executed)
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM
Polyglot
Polyglot from JavaScript to other Graal Truffle Languages
• Polyglot.eval can execute any language snippet
• It returns data objects (to read/write) or functions (that can be executed)
ACEs@home | How and why GraalVM is quickly becoming relevant for you
GraalVM
Polyglot
Node Application calling out to Java (and others)
• GraalVM can run Node & JS applications
• GraalJS /GraalVM can replace V8 as interpreter & execution engine
• GraalJS runs Java Byte code on JVM
• This engine is a Java application that works on any Java 8+
implementation
• Can run faster and better scalable to big memory structures
• However: it may need some warmup time to reach peak performance
• GraalVM 20.1: based on Node 12.15 and ECMAScript 2020 compliant
• Node application running with GraalVM can leverage GraalVMs Polyglot –
with Java as well as other languages (R, Ruby, Python, C++, …)
• Evaluate Code Snippets, Instantiate Objects, Share Data
ACEs@home | How and why GraalVM is quickly becoming relevant for you
application-bundle.jar
Node Application
Node Application calling out to Java
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Joker.class
GraalJS
JVM & GraalVM
Java 11 APIs
application-bundle.jar
Node Application
Node Application calling out to Java
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Joker.class
Get hold of Java Class and
instantiate Java Object
Invoke method on Object
and get String returned
Conclusion
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Quick Recap – What is GraalVM?
• Thomas Wuerthinger: “a new virtual machine that is trying to execute many
languages faster”
• JIT Foundation for the Long Term Evolution of HotSpot JVM
• Stable, observable, manageable and maintainable JVM with optimizations for
modern Java and JVM language patterns
• Serverless Java
• Small footprint, rapid startup time, simple & small run time
• Interoperability platform aka Polyglot VM
• Run and interact between many languages
• Bonus features
• Custom DSL
• Native interaction between C/C++ and Java
• Polyglot Tools: Debugger (with Chrome Dev Tools),
Profiler, GraalVM VisualVM, Ideal Graph Visualizer,
Visual Studio Code extension for GraalVM
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Adopting GraalVM in your team - your first steps
• Start exploring GraalVM – download & install, play and do a PoC
• Plenty of resources available (code samples, blog articles, tutorials, ..)
• Hybrid: have some containers running GraalVM (for Java applications)
instead of your traditional JVM brand
• to try out, check if it is stable and performant and (better) manageable
• Start leveraging polyglot
• single runtime for different programming languages)
• interoperability (benefit in Java from 3rd party libraries in JavaScript or Python [or vice
versa] and/or make better use of the skills in your team)
• better start creating standards and guidelines around when and how to polyglot!
• AOT/native - use GraalVM to build Java applications as native executables as last step
in the build process and deliver that executable instead of JAR files
• create Java based Serverless Functions with small footprint and very quick startup
• benefit from ultra fast and super small frameworks (Quarkus, Helidon, Micronaut, Vert.x, Spring, …)
ACEs@home | How and why GraalVM is quickly becoming relevant for you
Gra
alV
M
Pol
ygl
ot
Fortran
Haskell
Thank you for your attention
ACEs@home | How and why GraalVM is quickly becoming relevant for you
lucas.jellema@amis.nl | technology.amis.nl | @lucasjellema | lucas-jellema
bit.ly/graalvm-handson
1 of 60

Recommended

JVM++: The Graal VM by
JVM++: The Graal VMJVM++: The Graal VM
JVM++: The Graal VMMartin Toshev
6K views45 slides
Introduction to GraalVM by
Introduction to GraalVMIntroduction to GraalVM
Introduction to GraalVMSHASHI KUMAR
351 views14 slides
GraalVM by
GraalVMGraalVM
GraalVMNexThoughts Technologies
926 views15 slides
Discover Quarkus and GraalVM by
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
638 views19 slides
GraalVm and Quarkus by
GraalVm and QuarkusGraalVm and Quarkus
GraalVm and QuarkusSascha Rodekamp
509 views29 slides
Quarkus - a next-generation Kubernetes Native Java framework by
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
606 views42 slides

More Related Content

What's hot

Red Hat Java Update and Quarkus Introduction by
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
687 views41 slides
Meetup 23 - 03 - Application Delivery on K8S with GitOps by
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsVietnam Open Infrastructure User Group
462 views30 slides
Quarkus tips, tricks, and techniques by
Quarkus tips, tricks, and techniquesQuarkus tips, tricks, and techniques
Quarkus tips, tricks, and techniquesRed Hat Developers
1.3K views21 slides
Graal and Truffle: One VM to Rule Them All by
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllThomas Wuerthinger
15.3K views51 slides
Graal in GraalVM - A New JIT Compiler by
Graal in GraalVM - A New JIT CompilerGraal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT CompilerKoichi Sakata
2.7K views71 slides
Java EE から Quarkus による開発への移行について by
Java EE から Quarkus による開発への移行についてJava EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行についてShigeru Tatsuta
836 views43 slides

What's hot(20)

Red Hat Java Update and Quarkus Introduction by John Archer
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
John Archer687 views
Graal and Truffle: One VM to Rule Them All by Thomas Wuerthinger
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
Thomas Wuerthinger15.3K views
Graal in GraalVM - A New JIT Compiler by Koichi Sakata
Graal in GraalVM - A New JIT CompilerGraal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
Koichi Sakata2.7K views
Java EE から Quarkus による開発への移行について by Shigeru Tatsuta
Java EE から Quarkus による開発への移行についてJava EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行について
Shigeru Tatsuta836 views
Red Hat OpenStack - Open Cloud Infrastructure by Alex Baretto
Red Hat OpenStack - Open Cloud InfrastructureRed Hat OpenStack - Open Cloud Infrastructure
Red Hat OpenStack - Open Cloud Infrastructure
Alex Baretto1.1K views
Getting Started Monitoring with Prometheus and Grafana by Syah Dwi Prihatmoko
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
Syah Dwi Prihatmoko3.5K views
Introduction to Container Storage Interface (CSI) by Idan Atias
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
Idan Atias213 views
containerdの概要と最近の機能 by Kohei Tokunaga
containerdの概要と最近の機能containerdの概要と最近の機能
containerdの概要と最近の機能
Kohei Tokunaga3K views
BuildKitによる高速でセキュアなイメージビルド by Akihiro Suda
BuildKitによる高速でセキュアなイメージビルドBuildKitによる高速でセキュアなイメージビルド
BuildKitによる高速でセキュアなイメージビルド
Akihiro Suda42.6K views
Cloud Native Java GraalVM 이상과 현실 by Taewan Kim
Cloud Native Java GraalVM 이상과 현실Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실
Taewan Kim3.5K views
Prometheus: What is is, what is new, what is coming by Julien Pivotto
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
Julien Pivotto42 views
Introduction and Deep Dive Into Containerd by Kohei Tokunaga
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
Kohei Tokunaga455 views
Your Journey to Cloud-Native Begins with DevOps, Microservices, and Containers by Atlassian
Your Journey to Cloud-Native Begins with DevOps, Microservices, and ContainersYour Journey to Cloud-Native Begins with DevOps, Microservices, and Containers
Your Journey to Cloud-Native Begins with DevOps, Microservices, and Containers
Atlassian10.4K views
Introduction to Apache Kafka by Jeff Holoman
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
Jeff Holoman52.2K views
Reactive Microservices with Quarkus by Niklas Heidloff
Reactive Microservices with QuarkusReactive Microservices with Quarkus
Reactive Microservices with Quarkus
Niklas Heidloff577 views

Similar to How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - June 2020)

HOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVM by
HOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVMHOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVM
HOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVMOwais Zahid
260 views27 slides
How and why GraalVM is quickly becoming relevant for you (DOAG 2020) by
How and why GraalVM is quickly becoming relevant for you (DOAG 2020)How and why GraalVM is quickly becoming relevant for you (DOAG 2020)
How and why GraalVM is quickly becoming relevant for you (DOAG 2020)Lucas Jellema
206 views58 slides
Polygot Java EE on the GraalVM by
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVMRyan Cuprak
1K views49 slides
Introduction to Micronaut - JBCNConf 2019 by
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019graemerocher
1.4K views39 slides
Peru JUG Micronaut & GraalVM by
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMDomingo Suarez Torres
242 views16 slides
Simple tweaks to get the most out of your JVM by
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMJamie Coleman
140 views74 slides

Similar to How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - June 2020)(20)

HOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVM by Owais Zahid
HOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVMHOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVM
HOW TO CREATE AWESOME POLYGLOT APPLICATIONS USING GRAALVM
Owais Zahid260 views
How and why GraalVM is quickly becoming relevant for you (DOAG 2020) by Lucas Jellema
How and why GraalVM is quickly becoming relevant for you (DOAG 2020)How and why GraalVM is quickly becoming relevant for you (DOAG 2020)
How and why GraalVM is quickly becoming relevant for you (DOAG 2020)
Lucas Jellema206 views
Polygot Java EE on the GraalVM by Ryan Cuprak
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
Ryan Cuprak1K views
Introduction to Micronaut - JBCNConf 2019 by graemerocher
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
graemerocher1.4K views
Simple tweaks to get the most out of your JVM by Jamie Coleman
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
Jamie Coleman140 views
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by... by scalaconfjp
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
scalaconfjp842 views
Simple tweaks to get the most out of your jvm by Jamie Coleman
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
Jamie Coleman156 views
Magic with groovy & grails by George Platon
Magic with groovy & grailsMagic with groovy & grails
Magic with groovy & grails
George Platon581 views
Building Asynchronous Applications by Johan Edstrom
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom633 views
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach by PROIDEA
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav TulachJDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
PROIDEA88 views
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738] by David Buck
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
David Buck429 views
Apache Drill (ver. 0.1, check ver. 0.2) by Camuel Gilyadov
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
Camuel Gilyadov5K views
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus by Uni Systems S.M.S.A.
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusD. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
Serverless Java - Challenges and Triumphs by David Delabassee
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
David Delabassee282 views
Cloud computing - an insight into "how does it really work ?" by Tikal Knowledge
Cloud computing - an insight into "how does it really work ?" Cloud computing - an insight into "how does it really work ?"
Cloud computing - an insight into "how does it really work ?"
Tikal Knowledge766 views
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac... by Jeavon Leopold
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
Jeavon Leopold966 views

More from Lucas Jellema

Introduction to web application development with Vue (for absolute beginners)... by
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
58 views74 slides
Making the Shift Left - Bringing Ops to Dev before bringing applications to p... by
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...Lucas Jellema
28 views61 slides
Lightweight coding in powerful Cloud Development Environments (DigitalXchange... by
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...Lucas Jellema
8 views19 slides
Apache Superset - open source data exploration and visualization (Conclusion ... by
Apache Superset - open source data exploration and visualization (Conclusion ...Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Lucas Jellema
379 views27 slides
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI... by
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...Lucas Jellema
33 views49 slides
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG... by
Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...Lucas Jellema
74 views44 slides

More from Lucas Jellema(20)

Introduction to web application development with Vue (for absolute beginners)... by Lucas Jellema
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema58 views
Making the Shift Left - Bringing Ops to Dev before bringing applications to p... by Lucas Jellema
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Lucas Jellema28 views
Lightweight coding in powerful Cloud Development Environments (DigitalXchange... by Lucas Jellema
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lucas Jellema8 views
Apache Superset - open source data exploration and visualization (Conclusion ... by Lucas Jellema
Apache Superset - open source data exploration and visualization (Conclusion ...Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...
Lucas Jellema379 views
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI... by Lucas Jellema
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
Lucas Jellema33 views
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG... by Lucas Jellema
Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Lucas Jellema74 views
Op je vingers tellen... tot 1000! by Lucas Jellema
Op je vingers tellen... tot 1000!Op je vingers tellen... tot 1000!
Op je vingers tellen... tot 1000!
Lucas Jellema51 views
IoT - from prototype to enterprise platform (DigitalXchange 2022) by Lucas Jellema
IoT - from prototype to enterprise platform (DigitalXchange 2022)IoT - from prototype to enterprise platform (DigitalXchange 2022)
IoT - from prototype to enterprise platform (DigitalXchange 2022)
Lucas Jellema35 views
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch... by Lucas Jellema
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Lucas Jellema55 views
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca... by Lucas Jellema
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Lucas Jellema460 views
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel... by Lucas Jellema
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Lucas Jellema281 views
Introducing Dapr.io - the open source personal assistant to microservices and... by Lucas Jellema
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
Lucas Jellema303 views
How and Why you can and should Participate in Open Source Projects (AMIS, Sof... by Lucas Jellema
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Lucas Jellema515 views
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo... by Lucas Jellema
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Lucas Jellema491 views
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022) by Lucas Jellema
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Lucas Jellema372 views
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2... by Lucas Jellema
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
Lucas Jellema215 views
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022) by Lucas Jellema
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Lucas Jellema350 views
Tech Talks 101 - DevOps (jan 2022) by Lucas Jellema
Tech Talks 101 - DevOps (jan 2022)Tech Talks 101 - DevOps (jan 2022)
Tech Talks 101 - DevOps (jan 2022)
Lucas Jellema69 views
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2... by Lucas Jellema
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Lucas Jellema416 views
Cloud Native Application Development - build fast, low TCO, scalable & agile ... by Lucas Jellema
Cloud Native Application Development - build fast, low TCO, scalable & agile ...Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Lucas Jellema157 views

Recently uploaded

virtual reality.pptx by
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
14 views15 slides
NET Conf 2023 Recap by
NET Conf 2023 RecapNET Conf 2023 Recap
NET Conf 2023 RecapLee Richardson
10 views71 slides
SUPPLIER SOURCING.pptx by
SUPPLIER SOURCING.pptxSUPPLIER SOURCING.pptx
SUPPLIER SOURCING.pptxangelicacueva6
16 views1 slide
Melek BEN MAHMOUD.pdf by
Melek BEN MAHMOUD.pdfMelek BEN MAHMOUD.pdf
Melek BEN MAHMOUD.pdfMelekBenMahmoud
14 views1 slide
Democratising digital commerce in India-Report by
Democratising digital commerce in India-ReportDemocratising digital commerce in India-Report
Democratising digital commerce in India-ReportKapil Khandelwal (KK)
18 views161 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
19 views49 slides

Recently uploaded(20)

ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely25 views
Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman36 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
Powerful Google developer tools for immediate impact! (2023-24) by wesley chun
Powerful Google developer tools for immediate impact! (2023-24)Powerful Google developer tools for immediate impact! (2023-24)
Powerful Google developer tools for immediate impact! (2023-24)
wesley chun10 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software280 views

How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - June 2020)

  • 1. How and why GraalVM is quickly becoming relevant for you ACEs@home | How and why GraalVM is quickly becoming relevant for you ACEs@home – 17th June 2020 Lucas Jellema, CTO & Architect AMIS, Oracle ACE Director & Groundbreaker Ambassador
  • 2. Demo ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 3. Demo ACEs@home | How and why GraalVM is quickly becoming relevant for you bit.ly/graalvm-handson
  • 4. GraalVM ACEs@home | How and why GraalVM is quickly becoming relevant for you Custom DSL
  • 5. Oh boy, we will be in so much trouble… ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 6. What is GraalVM? ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 7. ACEs@home | How and why GraalVM is quickly becoming relevant for you Performance and Resource Consumption of GraalVM vs C2
  • 8. What is GraalVM - beyond a better JIT compiler? ACEs@home | How and why GraalVM is quickly becoming relevant for you Native Image Custom DSL Polyglot Tools
  • 9. Introducing • JIT Compiler for running Java applications faster (matching native languages for speed) • Embeddable on Hotspot VM or other JVMs • Polyglot VM – for running applications in any language • JavaScript, Ruby, R, Python, C/C++ • Ahead-of-Time compiler for creating native binaries • Simple, lean runtime with fast startup and minimal memory and process footprint • Interoperability platform that allows applications in one technology to interact with with modules in other technologies (“Nashorn on super steroids”) • Framework for compiling, running, interoperating and natively compiling applications written in your own DSL • Set of cross-language programming tools ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 10. (limited) Spring Boot support for GraalVM native images 2017 Some history on GraalVM ACEs@home | How and why GraalVM is quickly becoming relevant for you Project spun off from Maxine VM 2012 Proof of Concept: a compiler written in Java (with all its software engineering advantages) could generate highly optimized code without compromising on compile times 2019 Twitter started to run its many Scala applications on the GraalVM JIT Compiler to save money and CPU cycles 20.1.0 May, 2020 WebLogic Certified on GraalVM GraalVM “productized” at Oracle ES2020 support GraalVM Advisory Board Spring Framework 5.3 with GraalVM AOT support WebAssembly support Oracle Database MLE GraalVM support in Helidon, Micronaut & Quarkus Coherence support for GraalVM Project Fn GraalVM enabled Java 11 support
  • 11. GraalVM: Two Editions ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 12. GraalVM EE included in all OCI subscriptions ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Enterprise is included in all Oracle Cloud Infrastructure (OCI) subscriptions so you can use it for no additional charge (Compute, OKE, Functions)
  • 13. Today, we will focus on • JIT Compiler for running Java applications faster (matching native languages) • on Hotspot VM or other traditional VMs • Polyglot VM – for running applications in any language • JavaScript, Ruby, R, Python, C/C++ • Ahead-of-Time compiler for creating native binaries • Simple, lean runtime with fast startup and minimal memory and process footprint • Interoperability platform that allows applications in one technology to interact with with modules in other technologies (“Nashorn on super steroids”) • Framework for compiling, running, interoperating and natively compiling applications written in your own DSL • Set of cross-language programming tools ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 14. GraalVM: Polyglot Runtime ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 15. Polyglot Run Time ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 16. Why do we have so many languages? ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 17. Polyglots – speak and understand many languages ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 18. GraalVM Polyglot Runtime • GraalVM can run (on the mature, manageable, observable and run time optimized JVM) • Java • JVM Languages • Many other languages • Through Truffle produced intermediate code • Including Static Languages through Sulong- an LLVM IR interpreter ACEs@home | How and why GraalVM is quickly becoming relevant for you Fortran Haskell Truffle Your own Custom DSL
  • 19. GraalVM: Ahead-of-Time compiler ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 20. GraalVM compile modes ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 21. GraalVM compile modes ACEs@home | How and why GraalVM is quickly becoming relevant for you JIT java MyMainClass
  • 22. GraalVM compile modes ACEs@home | How and why GraalVM is quickly becoming relevant for you JIT java MyMainClass AOT native-image MyMainClass ./mymainclass
  • 23. Ahead-of-Time Compilation ACEs@home | How and why GraalVM is quickly becoming relevant for you Application Substrate VM JDK Libraries All Java classes from your application, JDK and Substrate VM Points- to analysis Run initializations Heap snapshotting Iterative analysis on all reachable methods, fields and classes Machine Code Image Heap Native executable Application running without dependency on JDK Input Analysis Output
  • 24. AOT vs JIT: Startup Time JIT • Load JVM executable • Load the classes from the file system • Verify bytecode • Start interpreting • Run static initializers • First tier compilation (C1) • Run (suboptimal) • Gather profiling feedback • Second tier compilation (GraalVM or C2) • Run with best machine code AOT • Load executable with prepared heap • Immediately start with best machine code ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 25. AOT vs JIT: Memory Footprint JIT • Loaded JVM executable • Application data • Loaded bytecodes • Reflection meta-data • Code cache • Profiling data • JIT compiler data structures AOT • Loaded application executable • Application data ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 26. Microservices – Serverless – Containers ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 27. AOT vs JIT ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 28. Frameworks adopting native image ACEs@home | How and why GraalVM is quickly becoming relevant for you Helidon SE (Oracle) A set of Java Libraries for writing microservices Micronaut JVM-based framework for building light-weight modular applications (microservices) Quarkus (Red Hat) Kubernetes-native Java framework tailored for GraalVM and Hotspot
  • 29. Polyglot Platform with Language Interoperability ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 30. Polyglot Interoperability • Establish frictionless interaction between language contexts • To benefit from the best of all wor(l)ds ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 31. ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 32. Polyglot Interoperability • Establish frictionless interaction between language contexts • To benefit from the best of all wor(l)ds • Call out to ‘other world’ in a native way • Receive response in interpretable format • Minimal hoops to jump through at design time • Minimal performance overhead at run time • Uncomplicated run time environment • Despite multiple runtime execution languages • Basically: polyglot with the ease of mono-glot ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 33. Current interoperability on JVM • Current interoperability options from Java: • file or queue based interaction • REST API • native interfaces (such as Java JNI and JNA) • JSR-223 Interoperability - for example Nashorn (and support for many other scripting languages); • intra-JVM, Java Byte code level interop between Java/Groovy/Kotlin/JRuby/Jython • Less than perfect: complex, suboptimal performance, technical limitations, variations in approach, complex runtime environments, complex testing ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 34. All languages are used to express and communicate very similar concepts ACEs@home | How and why GraalVM is quickly becoming relevant for you Meta Language (concepts, grammar, structure)
  • 35. All programming languages are used to express and execute very similar concepts ACEs@home | How and why GraalVM is quickly becoming relevant for you Abstract Syntax Tree (variables, loops, conditions, calls, arithmetic)
  • 36. GraalVM can merge and run (Java Byte) code derived from various origins • GraalVM provides generic objects in all supported languages to make Polyglot call-outs, evaluate embedded foreign code and share data across language contexts • Thus enabling interoperability ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Polyglot Fortran Haskell
  • 37. The New Beast between Java and JavaScript • Out go Rhino and Nashorn • In comes GraalVM ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 38. From Java to JavaScript • Evaluate JS snippets • Load and call JavaScript sources • Exchange data and objects back and forth • Allow JavaScript to callback to Java objects • Run multiple JavaScript threads in parallel • Note: what applies to JavaScript by and large applies to all languages that can run on GraalVM through Truffle • Including Python, R, Ruby, LLVM (C/C++, Rust, Swift,…) • Your own DSL ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 39. From Java to JavaScript Evaluate a Simple Code Snippet ACEs@home | How and why GraalVM is quickly becoming relevant for youJFall 2019 - HOW AND WHY GRAALVM Create Polyglot context Evaluate Snippet Import Graal Polyglot package
  • 40. From Java to JavaScript Evaluate a Simple Code Snippet ACEs@home | How and why GraalVM is quickly becoming relevant for youJFall 2019 - HOW AND WHY GRAALVM Create Polyglot context Evaluate Snippet Evaluate Snippet => instantiate function Execute function Import Graal Polyglot package
  • 41. From Java to JavaScript Evaluate a Simple Code Snippet ACEs@home | How and why GraalVM is quickly becoming relevant for youJFall 2019 - HOW AND WHY GRAALVM Create Polyglot context Evaluate Snippet Evaluate Snippet => instantiate function Execute function Handle Exception from JS Import Graal Polyglot package
  • 42. A Typical Java Challenge (aided by JavaScript interaction) • Developing a Java application • I need to perform validations on input data • Postal Code (various countries), Mobile Phone Numbers (many countries), Email Address, Credit Card Number etc. • NPM Module Validator offers most of these OOTB • But… it is written in JavaScript • How does that help me? ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 43. A Typical Java Challenge • Developing a Java application • I need to perform validations on input data • Postal Code (various countries), Mobile Phone Numbers (many countries), Email Address, Credit Card Number etc. • In Pseudo Code: • ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 44. Community package in JavaScript for dozens of predefined validations ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 45. JavaScript Validator Module is compatible with GraalJS ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 46. A Typical Java Challenge – Resolved (with GraalVM) • Embrace GraalVM as the Java runtime • Install npm module validator • Install and use webpack to create a single bundle for module validator • Extend Java application • Import GraalVM Polyglot package • Create JavaScript Context • Load validator_bundled.js into context • Get desired JS functions from bindings map • Execute required JS functions as if they were Java methods ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 47. A Typical Java Challenge – Resolved (with GraalVM) ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 48. Polyglot and Ahead of Time Compiled Native Binary • A multi-lingual or polyglot Java application can be turned into a Native Binary Executable using GraalVM Ahead of Time compilation • Non JVM-languages can be included but are not compiled ahead of time • The build process for the binary executable takes long & uses a lot of memory • The outcome: a single, smal[lish] file running on plain Linux with fast startup & low memory footprint • For example in Alpine Linux Container or in Linux Binary Serverless Function ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Polyglot Fortran Haskell GraalVM Native Image (binary executable) application
  • 49. Polyglot from Node | Python | Ruby | R| … to any language on GraalVM ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 50. Polyglot from non-JVM languages • Any language running on GraalVM can participate in Polyglot interoperability • Evaluate & Execute Snippets in other languages • Export data and objects through the Polyglot Map to other execution contexts • Import data and objects from the Polyglot Map from other language contexts • Read, write & execute • Interacting with JVM based languages is slightly different • Use Java Type to construct native object based on a Java Class ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Polyglot Fortran Haskell
  • 51. Polyglot from non-JVM languages Dutch National Police Case: Scala  (Fast)R on GraalVM ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Polyglot
  • 52. Polyglot from JavaScript to other Graal Truffle Languages • Polyglot.eval can execute any language snippet • It returns data objects (to read/write) or functions (that can be executed) ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Polyglot
  • 53. Polyglot from JavaScript to other Graal Truffle Languages • Polyglot.eval can execute any language snippet • It returns data objects (to read/write) or functions (that can be executed) ACEs@home | How and why GraalVM is quickly becoming relevant for you GraalVM Polyglot
  • 54. Node Application calling out to Java (and others) • GraalVM can run Node & JS applications • GraalJS /GraalVM can replace V8 as interpreter & execution engine • GraalJS runs Java Byte code on JVM • This engine is a Java application that works on any Java 8+ implementation • Can run faster and better scalable to big memory structures • However: it may need some warmup time to reach peak performance • GraalVM 20.1: based on Node 12.15 and ECMAScript 2020 compliant • Node application running with GraalVM can leverage GraalVMs Polyglot – with Java as well as other languages (R, Ruby, Python, C++, …) • Evaluate Code Snippets, Instantiate Objects, Share Data ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 55. application-bundle.jar Node Application Node Application calling out to Java ACEs@home | How and why GraalVM is quickly becoming relevant for you Joker.class GraalJS JVM & GraalVM Java 11 APIs
  • 56. application-bundle.jar Node Application Node Application calling out to Java ACEs@home | How and why GraalVM is quickly becoming relevant for you Joker.class Get hold of Java Class and instantiate Java Object Invoke method on Object and get String returned
  • 57. Conclusion ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 58. Quick Recap – What is GraalVM? • Thomas Wuerthinger: “a new virtual machine that is trying to execute many languages faster” • JIT Foundation for the Long Term Evolution of HotSpot JVM • Stable, observable, manageable and maintainable JVM with optimizations for modern Java and JVM language patterns • Serverless Java • Small footprint, rapid startup time, simple & small run time • Interoperability platform aka Polyglot VM • Run and interact between many languages • Bonus features • Custom DSL • Native interaction between C/C++ and Java • Polyglot Tools: Debugger (with Chrome Dev Tools), Profiler, GraalVM VisualVM, Ideal Graph Visualizer, Visual Studio Code extension for GraalVM ACEs@home | How and why GraalVM is quickly becoming relevant for you
  • 59. Adopting GraalVM in your team - your first steps • Start exploring GraalVM – download & install, play and do a PoC • Plenty of resources available (code samples, blog articles, tutorials, ..) • Hybrid: have some containers running GraalVM (for Java applications) instead of your traditional JVM brand • to try out, check if it is stable and performant and (better) manageable • Start leveraging polyglot • single runtime for different programming languages) • interoperability (benefit in Java from 3rd party libraries in JavaScript or Python [or vice versa] and/or make better use of the skills in your team) • better start creating standards and guidelines around when and how to polyglot! • AOT/native - use GraalVM to build Java applications as native executables as last step in the build process and deliver that executable instead of JAR files • create Java based Serverless Functions with small footprint and very quick startup • benefit from ultra fast and super small frameworks (Quarkus, Helidon, Micronaut, Vert.x, Spring, …) ACEs@home | How and why GraalVM is quickly becoming relevant for you Gra alV M Pol ygl ot Fortran Haskell
  • 60. Thank you for your attention ACEs@home | How and why GraalVM is quickly becoming relevant for you lucas.jellema@amis.nl | technology.amis.nl | @lucasjellema | lucas-jellema bit.ly/graalvm-handson

Editor's Notes

  1. Run PrimeNumbers – what happens? JRE startup Interpreted mode After some time: JIT compilation of Java byte code to machine code; After more time: runtime optimization; runs on GraalVM What is size of runtime environment: Class file + JRE; memory footprint: 10 – 150 MB Run native primes – what happens: instant start/execution of already natively compiled machined code Runtime: just the executable (size 10MB) Performance and [low] Resource Usage of Ahead of Time Compiled Java application
  2. Run HelloWorld – what happens? JRE startup JIT compilation of Java byte code to machine code; runtime optimization; runs on GraalVM What is size of runtime environment: Class file + JRE; memory footprint: 10 – 150 MB Run native helloworld – what happens: instant start/execution of already natively compiled machined code Runtime: just the executable (size 10MB) Performance and [low] Resource Usage of Ahead of Time Compiled Java application
  3. Overview of main themes and topics (instead of boring list of all topics in the agenda) We can make this slide build – to indicate the order of the topics High-performance modern Java Low-footprint, fast-startup Java Combine JavaScript, Java, Ruby, and R
  4. Spaghetti… Hotspot C2 compiler for runtime optimizations had gotten very complicated and very hard to maintain. It does not support optimization for modern code patterns. The C++ code had gotten out of hand
  5. https://en.wikipedia.org/wiki/GraalVM
  6. https://openjdk.java.net/projects/graal/
  7. Spaghetti… Hotspot C2 compiler for runtime optimizations had gotten very complicated and very hard to maintain. It does not support optimization for modern code patterns. The C++ code had gotten out of hand
  8. https://blogs.oracle.com/graalvm/accelerating-oci-applications-with-graalvm-enterprise  For OCI user workloads, GraalVM Enterprise can be used in the following deployment scenarios: Bare Metal and Virtual Machines (OCI Compute) Containers (Oracle Container Engine for Kubernetes) Functions (Oracle Functions)
  9. Human Languages Computer Programming Languages (personal taste, libraries, suitability for certain tasks, legacy) Office politics, commercial
  10. Human Languages Computer Programming Languages (personal taste, libraries, suitability for certain tasks, legacy) Office politics, commercial
  11. At this part of our presentation, we will focus on JVM-based languages and try to explain the difference between 2 compilation modes provided by GraalVM.
  12. Let's start with (JIT) Just in Time compiler. This is the default way of compiling JVM based applications. JVM is a run-time environment that interprets Java application into Java bytecode and then uses something called a (JIT) just-in-time compiler which compiles the Java bytecode into native machine code while you are running your application. This means that a Java application gets more optimized and faster while running and this is also the reason why Java gets as fast as it is and how it can run some code faster than C++ Java HotSpot VM has two JIT compilers. C1 also called the client compiler. C1 create your first machine code. You do that because there's such a big difference between the interpreter speed and the final machine code speed. So, you need an intermediate solution. This intermediate solution is provided by the C1 client compiler, and this intermediate solution has something in there that gathers profiling feedback, information about how the application is running the code. Then, when a method gets really hot, meaning method is executed around 10.000 times, then the method is scheduled for the second compiler, and this is when the heavyweight compiler, C2 compiler, comes in and uses all the information gathered during the startup sequence of the application to create the final, very optimized machine code and then you execute faster. These HotSpot compilers exist for a while and optimized for certain workloads but the way how we program has changed over time. How we use today JVM is very different from what we did 20 years ago. Today we run on JVM other languages like Groovy and Scala. So there are different constructs that are reaching JIT compiler and some of the optimization phases that have been originally placed in compilers are not taking into account the complexity of those new constructs. So, when focusing on modern programs running on top of JVM we could do a better job by writing a new optimization phase for this new type of program. In this context, GraalVM replaces HotSpot's C2 compiler. GraalVM is designed for optimization of modern code shapes, such as Scala or Kotlin but also for modern types of Java code, for example, if you use latest stream API expressions or even lambdas. Only production implementation of GraalVM is in this domain, by Twitter. Where Twitter is using GraalVM to compile Scala code. Enabling their microservices to use less memory with improvements in garbage collection. Less CPU spent on GC.
  13. But let's look at a different compilation mode, which is unique to GraalVM and that is (AOT) Ahead of Time compilation. GraalVM has a way that takes a JVM based application and then does so-called Closed World Analysis, where it figures out all the code that is reachable from the application entry point and triggers Ahead of Time compiler which creates machine code, a binary that can run by its own with no need for JVM to be present! Also known as Java native image. You can also statically link system library, with --static flag when you are creating native binary and in that case, you can run that native binary on bear metal docker image. So, you don't even need a Linux distribution or anything like that when you run on Docker.
  14. So let's see what is all happening in this Ahead of Time compiler in order to produce a native image. At first step as input, GraalVM is taking everything that is consumed by the Java application, meaning the libraries, the JDK libraries, also resource like SubstrateVM, and what it does is a Closed World Analysis. Closed World Analysis is an analysis of all reachable methods, fields and classes from the main class of the application. Because when you create this package binary, you don't want to include every JDK class there is, you don't want to include every library class there is. You want to package only what is used by your application, so Graal does a point-to analysis of what is reachable from the entry point of the application. Graal runs some of the static initializers and creates heap snapshots. Then, we put everything together in a single binary. We put all the code AOT compiled code into the machine code section, and we write down a snapshot of the Java application as it was when initialized into the image heap section. This allows us to pre-initialize certain values or configuration parameters of the application, and we don't need to load them again when we start this binary. This binary has a GC inside, so it still has some run-time system but it does no longer contain interpreter nor JIT compiler. AOT has a less advanced GC comparing it with JIT GC and no profiling data is collected for further improvement like in JIT Startup time is probably the area where the Ahead of Time compilation is beating the JIT compilation by the largest margin
  15. Native Image does not support all features of JIT. Dynamic class loading is not supported, and cannot be supported by Graal AOT execution model. During native image generation, Graal runs an aggressive static analysis that requires a closed-world assumption. For that, Graal needs to know all classes and all bytecodes that are ever reachable. Reflection. Some types of Reflection are automatically detected by Graal and some more complex cases need an additional configuration. Reflection needs to be known, flagged ahead-of-time. Native Image tries to resolve these elements through a static analysis that detects calls to the reflection API. Security Manager. Since there is no dynamic class loading, there is also no need for this feature. JMX. These interfaces require access to Java bytecodes, which are no longer available at run time. If your code is not using Dynamic class loading and you handle reflection cases carefully you should be good to go.
  16. First of all you load the classes, the Java byte codes from your disk, then you have to verify the byte codes, then you start interpreting your byte codes. And then what you do on the Java HotSpot virtual machine is that you create a first-tier compilation. You use a fast compiler, which is C1, the client compiler of HotSpot to create your first machine code. You do that because you want to speed up your application as fast as possible. Then, when a method gets really hot, meaning you've had to first compile, you've got some profile, then the method is scheduled for the second compiler, and this is when the heavyweight compiler, either the C2 compiler or the GraalVM compiler comes in and uses all the information gathered during the startup sequence of the application to create the final, hopefully, very good machine code, and then you execute faster.  As you can see there's a long sequence here, and this is the main reason why an application that is running on the Java Virtual Machine is starting up slowly.
  17. First of all you load the classes, the Java byte codes from your disk, then you have to verify the byte codes, then you start interpreting your byte codes. And then what you do on the Java HotSpot virtual machine is that you create a first-tier compilation. You use a fast compiler, which is C1, the client compiler of HotSpot to create your first machine code. You do that because you want to speed up your application as fast as possible. Then, when a method gets really hot, meaning you've had to first compile, you've got some profile, then the method is scheduled for the second compiler, and this is when the heavyweight compiler, either the C2 compiler or the GraalVM compiler comes in and uses all the information gathered during the startup sequence of the application to create the final, hopefully, very good machine code, and then you execute faster.  As you can see there's a long sequence here, and this is the main reason why an application that is running on the Java Virtual Machine is starting up slowly.
  18. When we are comparing AOT vs JIT compiler we can notice that AOT mode focusses on maximized startup time, memory footprint and packaging size. And we should still use JIT when Peak Throughput and Max Latency are important. Also, the nature of how you run your application is important. For example, if the run time of your application is measured in weeks or months and the size of your heap is huge, then JIT compiler will provide you most benefits. But if you are running a small service (microservice) or even a (serverless) function, where the runtime is measured in hours, minutes, seconds then you should try AOT. can we get AOT better? There are a couple things we're currently exploring to get AOT better on the areas where the JIT compiler currently is better. One is the profile guided optimizations where we collect the profiles up-front. Another one is we're working on a low-latency GC option also for the native images. This puts at least some max latency, the two versions at the same level. Then, we are continuously working to improve the way you can create native images by having, for example, a tracing agent that will automatically create your configuration. Currently, if you want to use native images, the best bet is to use one of the frameworks that has support for it, meaning, Helidon, Micronaut, or Quarkus, because those frameworks help you with some of the configurations you need to create that small thing.
  19. Saying this all, there are already few frameworks that have adopted GraalVM and the concept of native Java images and they all are targeting cloud-native microservices: Containers (cost of cloud resources, memory) Serverless (startup time of functions) Polyglot development In a later demo, we will dive deeper into the world of Quarkus. A supersonic, subatomic, cloud-native Java framework.
  20. https://www.npmjs.com/package/validator
  21. https://www.npmjs.com/package/validator
  22. https://www.npmjs.com/package/validator
  23. https://www.npmjs.com/package/validator
  24. https://www.npmjs.com/package/validator
  25. https://www.npmjs.com/package/validator
  26. https://www.npmjs.com/package/validator https://www.graalvm.org/docs/reference-manual/compatibility/#validator
  27. https://www.npmjs.com/package/validator https://www.graalvm.org/docs/reference-manual/compatibility/#validator
  28. https://www.npmjs.com/package/validator https://www.graalvm.org/docs/reference-manual/compatibility/#validator
  29. https://www.npmjs.com/package/validator
  30. var FileClass = Java.type('java.io.File'); var file = new FileClass("myFile.md"); https://www.graalvm.org/docs/reference-manual/languages/js/ https://github.com/graalvm/graaljs/blob/master/docs/user/JavaInterop.md Node.js applications running on GraalVM's JavaScript engine have access to all of Node.js' APIs, including built-in Node.js' modules such as 'fs', 'http', etc. Conversely, JavaScript code embedded in a Java application has access to limited capabilities, as specified through the Context API, and do not have access to Node.js' built-in modules.
  31. var FileClass = Java.type('java.io.File'); var file = new FileClass("myFile.md"); https://www.graalvm.org/docs/reference-manual/languages/js/ https://github.com/graalvm/graaljs/blob/master/docs/user/JavaInterop.md Node.js applications running on GraalVM's JavaScript engine have access to all of Node.js' APIs, including built-in Node.js' modules such as 'fs', 'http', etc. Conversely, JavaScript code embedded in a Java application has access to limited capabilities, as specified through the Context API, and do not have access to Node.js' built-in modules.
  32. https://www.graalvm.org/docs/reference-manual/languages/js/ https://github.com/graalvm/graaljs/blob/master/docs/user/JavaInterop.md Node.js applications running on GraalVM's JavaScript engine have access to all of Node.js' APIs, including built-in Node.js' modules such as 'fs', 'http', etc. Conversely, JavaScript code embedded in a Java application has access to limited capabilities, as specified through the Context API, and do not have access to Node.js' built-in modules.
  33. https://www.graalvm.org/docs/reference-manual/tools
  34. https://visualvm.github.io/graal.html https://github.com/oracle/graal/tree/master/vscode/graalvm https://www.graalvm.org/docs/reference-manual/tools/#visual-studio-code-extensions-for-graalvm https://www.graalvm.org/docs/reference-manual/tools/