Graalvm JIT Compiler
Total Page:16
File Type:pdf, Size:1020Kb
Partner Webcast – Cloud Native Java with GraalVM on OCI Catalin Pohrib Oracle EMEA A&C Partner Technology Cloud Engineer Oracle EMEA CCOE January 21, 2021 Safe harbor statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. 3 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Agenda 1 Oracle GraalVM Enterprise Overview 2 GraalVM on OCI Features 3 Accelerating Application Performance 4 Demo 5 Summary and Q&A 4 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Agenda 1 Oracle GraalVM Enterprise Overview 2 GraalVM on OCI Features 3 Accelerating Application Performance 4 Demo 5 Summary and Q&A 5 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Enterprises worldwide run 45 billion active Java VMs 55% Java is the only language used by > 55% of businesses worldwide1 #1 in 10 of the top 14 technology trends2 #1 programming language in the world3 Java powers your business-critical applications 1 , 2 VDC Research 2019 3 Tiobe Index February 2020 – https://www.tiobe.com/tiobe-index/ 6 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. What is GraalVM Enterprise? GraalVM Enterprise • high-performance • polyglot compiler • run-time built for modern microservices For both cloud-native and on-premise environments. 7 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Oracle GraalVM Enterprise Edition Faster Smarter Leaner • 50% faster on average on real • 27 patented optimizations • Lower memory required world benchmarks • Compile to native executables • Higher throughput with lower • Native executables start • Leverage multiple languages CPU usage instantaneously • Reduced garbage collection overhead 8 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise - Areas of Opportunity Traditional Java Microservices Multi-Language Embedded Workloads & Cloud Applications Tomcat 9 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise - Solutions Traditional Java Microservices Multi-Language Embedded Workloads & Cloud Applications High-performance Ahead-of-Time (AOT) Multi-lingual Virtual Software for devices optimizing Just-in- “native image” compiler Machine Time (JIT) compiler 10 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise Just-in-time compilation 11 GraalVM Enterprise high performance optimizing compiler Java JIT Compiler Oracle Java SE JVM 12 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise high performance optimizing compiler Java Bytecode JIT Compiler Oracle Java SE JVM 13 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise high performance optimizing compiler GraalVM JIT Compiler 14 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Increased performance in real-world application benchmarks RUNNING TIME VS MEMORY, NAIVE-BAYES, JDK 11 5,0 (LOWER IS BETTER) 4,31 4,5 4,30 OpenJDK 11 GraalVM Enterprise (JDK 11) 4,0 3698 3619 3,5 3110 3,0 2,66 2542 2,34 2,33 2,5 2,31 1942 1822 1,84 1717 2,0 1,78 Speedup vsJDK8 1,55 1,52 1,44 1333 1,40 1,36 1,35 1,31 1,5 1,27 1,22 1,18 1,14 1,14 1,14 1,12 1,09 1,08 1,03 1,02 1,0 457 423 0,5 0,0 5 GB 6 GB 7 GB 8 GB 10 GB https://Renaissance.dev Source: https://blogs.oracle.com/graalvm/apache-spark%e2%80%94lightning-fast-on-graalvm-enterprise 15 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Why is GraalVM Enterprise FASTER? JDK 8/11 CPU Memory Execution Time 16 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Why is GraalVM Enterprise FASTER? JDK 8/11 CPU Memory GraalVM CPU Execution Time 17 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise in Oracle Cloud Infrastructure Real-world example 25% reduction in garbage collection time 10% improvement in transactions/sec 0 0 issues 30+ Million core hours GraalVM Powers Oracle Cloud Infrastructure 18 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Agenda 1 Oracle GraalVM Enterprise Overview 2 GraalVM on OCI Features 3 Accelerating Application Performance 4 Demo 5 Summary and Q&A 19 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise: Oracle Cloud Platform’s Java Runtime Hybrid Application Manager Node.js C++ Ruby Traditional applications Java Microservices Python Polyglot Microservices R GraalVM Compiler and Runtime Cloud native environment Operating system On-premises Public cloud 20 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise Ahead-of-time compilation 21 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise native image: Ahead-of-time compiler & runtime GraalVM JIT Compiler GraalVM JIT Compiler GraalVM JIT Compiler 22 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise Native Image - Ahead-of-time compiler & runtime Microservices and Containers Up to 5x less memory 100x faster startup Linux Executable Windows Executable MacOS Executable 23 Copyright © 2021 GraalVM Enterprise native image: Ahead-of-time compiler & runtime Coming Soon! Supported by popular microservice frameworks MacOS Windows Linux Executable Executable Executable 24 Copyright © 2021 25 Copyright © 2021 25 Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Agenda 1 Oracle GraalVM Enterprise Overview 2 GraalVM on OCI Features 3 Accelerating Application Performance 4 Demo 5 Summary and Q&A 26 Copyright © 2021 GraalVM Enterprise Native Image - Ideal for Microservices Monolith vs. Microservices 27 Copyright © 2021 GraalVM Enterprise Native Image - Ideal for Microservices Monolith Microservices 28 Copyright © 2021 GraalVM Enterprise Native Image - drastic resource usage reductions Microservices and Containers Microservice on GraalVM Enterprise (JIT mode) GraalVM Enterprise Native Image generated microservice executable 29 Copyright © 2021 GraalVM Enterprise Native Image - Ideal for Microservices Monolith Microservices 30 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise Native Image - Ideal for Microservices Monolith Microservices Fixed Cost Variable Cost 31 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise Native Image Supported by microservice Ideal for Containers frameworks and platforms Coming Soon! 32 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. Microservices – startup time 23 ms 42x Helidon 979 ms 65x 30 ms Micronaut 1967 ms 11 ms 93x Quarkus 983 ms 0 ms 500 ms 1000 ms 1500 ms 2000 ms GraalVM Native Image JDK 8 33 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. Microservices – memory footprint 26 MByte 4x Helidon 107 MByte 5x 37 MByte Micronaut 198 MByte 16 MByte 10x Quarkus 160 MByte 0 MByte 50 MByte 100 MByte 150 MByte 200 MByte 250 MByte GraalVM Native Image JDK 8 34 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. SpringBoot apps running on GraalVM native image by Sébastien Deleuze Allows to start applications almost instantly Time to first request for Spring Boot 2.2 with Tomcat OracleJDK JIT GraalVM Native Image 0 500 1000 1500 2000 2500 3000 First request served (ms) https://youtu.be/3eoAxphAUIg 35 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise throughput Popular Framework Benchmark 20000 16% higher 18000 16000 1500% higher 14000 12000 10000 GraalVM Enterprise Native Image 8000 GraalVM Enterprise JIT JDK12, HotSpot Requestsper Second 6000 4000 2000 0 1.000 10.000 100.000 1.000.000 10.000.000 Cumulative number of requests sent by ApacheBench 36 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise compilation performance characteristics Peak Throughput Startup Speed Ahead-of-time Just-in-time Reduced Max Low Memory Latency Footprint Small Packaging 37 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise compilation performance characteristics Profile guided optimization Peak Throughput Startup Speed Ahead-of-time Just-in-time Reduced Max Low Memory Latency Footprint Small Packaging 38 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise Multi-language Support 39 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise multi-language support Ruby Interpreter GraalVM JIT Compiler JavaScript Interpreter Ruby Runtime JavaScript Runtime 40 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise multi-language support Language Implementation Framework GraalVM JIT Compiler 41 Copyright © 2021, Oracle and/or its affiliates. All rights reserved. GraalVM Enterprise language implementation framework • Expert provides "interpreter” for Language Implementation Framework • Existing implementations*: JS, R, Ruby, Python, LLVM, and WebAssembly • Interoperability – for example, JS code can call Language Implementation Framework Ruby methods and share values without copies GraalVM JIT Compiler