Explore the capabilities of GraalVM in our upcoming session, where we will cover key aspects such as optimizing startup times, enhancing resource efficiency, and enabling seamless language interoperability. Learn how GraalVM can significantly improve your application's performance and versatilit...
Explore the capabilities of GraalVM in our upcoming session, where we will cover key aspects such as optimizing startup times, enhancing resource efficiency, and enabling seamless language interoperability. Learn how GraalVM can significantly improve your application's performance and versatility by reducing latency, maximizing resource utilization, and facilitating the smooth integration of multiple programming languages.
Size: 3.41 MB
Language: en
Added: Jul 12, 2024
Slides: 25 pages
Slide Content
GraalVM – A step ahead of JVM Presented by: Vimal & Sakshi
Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time! Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call. Avoid Disturbance Avoid unwanted chit chat during the session.
Introduction to GraalVM Features of GraalVM JIT vs AOT Spring with AOT Cons of GraalVM Demo Performance comparison of JVM and AOT
Introduction to GraalVM 01
GraalVM High-performance JDK designed to enhance Java application performance Consumes fewer resources compared to standard JDKs Graal Compiler: Functions as a Just-In-Time (JIT) compiler for running Java applications on the HotSpot JVM Supports Ahead-Of-Time (AOT) compilation into native executables Polyglot Capabilities Provides runtimes for multiple languages, including JavaScript, Ruby, Python, and more Security and Optimization Reduced Attack Surface: Excludes unused classes, methods, and fields from the application binary Extended JVM Capabilities: Offers new performance optimizations and capabilities beyond standard JVM implementations
Features of GraalVM Low Resource Usage Improved Security Fast Startup & Scale Compact Packaging Multiple framework support Cloud support Polyglot Programming
JIT vs AOT 03
JIT v/s AOT Factors JIT(Just-In Time) AOT(Ahead Of Time) Timing of Compilation Compiles code just before execution during runtime. Compiles code before runtime, usually during the build or deployment phase. Execution Efficiency Optimizes code based on runtime profiling and platform-specific characteristics Generates optimized native code upfront, ensuring consistent performance from the start Startup Time May lead to longer startup times initially due to compilation overhead Generally, results in faster startup times as code is already compiled to native machine code Dynamic Code Adaptation Can dynamically optimize code based on runtime conditions and usage patterns. Optimizations are fixed during compilation and cannot adapt dynamically at runtime Deployment and Distribution Requires distributing bytecode or intermediate code for compilation on user machines Involves distributing pre-compiled native binaries, simplifying deployment and ensuring consistency across environments
Spring with AOT 04
Spring AOT SPRING BOOT RUN-TIME DISCOVERY AND CONFIGURATION NATIVE IMAGE BUILD-TIME DISCOVERY AND CONFIGURATION
Spring AOT SPRING BOOT NATIVE IMAGE SPRING AOT
Spring AOT SPRING AOT JAVA SOURCE FILES BYTECODE HINT FILES
Cross Platform Builds on GitHub Actions .jar .jar .class GraalVM GitHub Action Linux Executable MacOS Executable Windows Executable
Cons of GraalVM 05
Cons of Graal VM Longer Build Times Build times for native images are longer compared to standard JVM applications Maturity and Stability GraalVM is relatively new compared to the standard JVM, which may result in stability issues Platform dependent Native compilation requires same machine config on which it is intended to be executed Controlled support for Dynamic Features Dynamic class loading and reflection need explicit configuration to implement and optimize in native images.
DEMO 06
Demo POC Goals & Objective Application Compilation: Successfully compile the Spring Boot app to a native image Functional Validation: Ensure all functionalities work in the native image. Performance Benchmarks: Compare startup times, response times, and throughput. Memory Footprint Analysis: Document memory usage under various loads. Resource Utilization: Measure CPU and memory usage of the native image versus the JVM version
Prerequisite If you have GraalVM already installed and have experience using it, you can skip else need to set it up for your operating system Choose your operating system and proceed to the installation steps for your specific platform: Linux macOS Windows Docker Container Once you set up the GraalVM you check it using java -version Install the native image extensions gu install native-image can verify using native - -version
Build container images with GraalVM and buildpacks Add below to your pom.xml Build the image