4. S O F T WA R E D E V E L O P M E N T
Turnkey
development
Atlassian
Solution
Partner
Consulting and
support in
software
architecture and
analysis
Application
integration
Evolutionary support
of our own
developments or
inherited ones
@alberto_deavila
7. G O A L S
✴ Increase our JVM performance
✴ Future of JVM
✴ Programming languagues interoperability
✴ System independence
✴ Serverless
@alberto_deavila
8. ✴ GraalVM & features
✴ Show me more code
✴ Limits using GraalVM
✴ Future
S U M M A RY
@alberto_deavila
16. G R A A LV M
@alberto_deavila
Ecosystem and shared runtime offering
performance advantages to multiples
languages
17. G R A A LV M
@alberto_deavila Source: https://www.graalvm.org/docs/
18. S U P P O R T E D L A N G U A G E S
@alberto_deavila
✴ Native support:
✴ Support with installations: Ruby, Python, R
✴ JVM languages: Groovy, Kotlin, Java...
✴ LLVM: C, C++
✴ Javascript
19. ✴ Graal: the JIT compiler
✴ Graal Polyglot APIs: API to combine
programming languages
✴ Graal SDK: embedding Graal and configure
native images
✴ Oracle HotSpot JVM
G R A A LV M
@alberto_deavila
23. ✴ Interoperate with other languages
✴ Includes consoles for JS, R...
✴ Create compiled native images
✴ Run code faster & efficiently
✴ Tools to monitor, debug, and profile code
G R A A LV M F E AT U R E S
@alberto_deavila
27. ✴ Framework
✴ Allow to create languages interpreters
✴ Based on annotations
✴ Contains common things across any
language
G R A A LV M T R U F F L E
@alberto_deavila
28. G R A A LV M T R U F F L E
@alberto_deavila Source: https://res.infoq.com/presentations/polyglot-jvm-graal/en/slides/sl13.jpg
29. G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
JS RubyPython
Source: https://www.graalvm.org/docs/reference-manual/polyglot/
30. G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
JS RubyPython
Source: https://www.graalvm.org/docs/reference-manual/polyglot/
31. G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
JS RubyPython
Source: https://www.graalvm.org/docs/reference-manual/polyglot/
32. G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
Node with R
Source: https://docs.google.com/presentation/d/1cBuq4rjaNTOMJOOeGvqnI2TJjWH2VBId7NtVVhXWJkY/edit#slide=id.g495524223b_0_179
33. ✴ Use the appropiate languague for any task
✴ Use libraries from differents languagues
✴ Create apps combining languages
✴ One environment for all requirements
G R A A LV M I N T E R O P E R A B I L I T Y
@alberto_deavila
35. ✴ Self-contained executable
✴ Fast startup
✴ Low memory consumption
✴ Can generate binary library
✴ Useful for lambdas, containers or command
line
G R A A LV M N AT I V E I M A G E S
@alberto_deavila
36. G R A A LV M N AT I V E I M A G E S
@alberto_deavila
GraalVM can generate native images BUT
not yet cross platform
Source: https://github.com/oracle/graal/issues/407
38. ✴ Analyze statically all code
✴ Compile reachable code
✴ Generates native code
✴ Package it with SubstrateVM
G R A A LV M A O T C
@alberto_deavila
39. ✴ Framework subset of JVM
✴ No JIT
✴ No optimization
✴ No Graal neither any related with bytecode
✴ Just runtime: GC, threads, I/O, ...
G R A A LV M S U B S T R AT E V M
@alberto_deavila
40. G R A A LV M N AT I V E I M A G E S
@alberto_deavila Source: https://twitter.com/cstancu/status/1103413247305166849
42. ✴ Depends on code optimizations
✴ Native images startup time is very fast
✴ Each languague has different perfomance
G R A A LV M P E R F O R M A N C E
@alberto_deavila
43. G R A A LV M P E R F O R M A N C E
@alberto_deavila Source: https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf
44. G R A A LV M P E R F O R M A N C E
@alberto_deavila Source: https://2017.jokerconf.com/en/2017/talks/3qdblcadmqy0me2uuieqaq/
Twitter performance using Graal
62. ✴ Generate native images from Micronaut app
✴ Java and Kotlin supported, Groovy partially
✴ Includes scripts or Dockerfile to generate it
✴ Generate automatically reflect.json
G R A A LV M + M I C R O N A U T
@alberto_deavila
63. ✴ Create a Micronaut app
✴ Create a controller:
G R A A LV M M I C R O N A U T
@alberto_deavila
Kotlin
64. ✴ Generate the image:
G R A A LV M M I C R O N A U T
@alberto_deavila
Kotlin
✴ Use it:
66. ✴ Evaluate static code at compile time
✴ No dynamic code
✴ Some strange exceptions appears
✴ Take long time to generate executable
✴ Only for Mac/Linux & 64 bits
L I M I TAT I O N S
@alberto_deavila
68. K O T L I N L I M I TAT I O N S
@alberto_deavila Source: https://github.com/oracle/graal/issues/366#issuecomment-383547970
✴ Almost all features work
✴ Some bugs / features to work, like:
✴ Does not support compilation of non-
reducible loops
70. ✴ Sometimes requires lot of changes / rewrite
✴ No metaprogramming
✴ Closures requires manual config
✴ Grape doesn't work on standalone native
images
G R O O V Y L I M I TAT I O N S
@alberto_deavila
71. G R O O V Y L I M I TAT I O N S
@alberto_deavila Source: https://e.printstacktrace.blog/graalvm-and-groovy-how-to-start/
72. L I M I TAT I O N S
@alberto_deavila Source: https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md
74. F U T U R E
@alberto_deavila
✴ More languages and tools will be available
✴ Apps with many languages working
✴ A native image compatible with all OS
✴ Better perfomance
✴ ...
75. M O R E I N F O
@alberto_deavila
✴ Offial Doc
✴ List of resources for Graal and related topics
✴ Videos and presentations
✴ Top 10 things to do with GraalVM
✴ Kotlin performance with GraalVM