Internal 2 About me - Working at Oracle Labs on Micronaut - Main focus on build plugins and dev productivitity - Formerly working at Gradle Inc - Author of static compiler of Groovy - Amateur astronomer https://www.astrobin.com/users/melix/ - Mastodon: @[email protected]
Internal 3 About Micronaut - Micronaut is focused on modern architectures like Serverless and Microservices - Also a complete framework for any type of application - Lightweight, reactive (HTTP Client/Server based on Netty) - Annotation processor to compute framework infrastructure at compile time
Internal 5 Micronaut modules Interesting Micronaut modules: - Micronaut Data: AoT compilation of repositories, queries, build time validation with lightweight runtime - Micronaut Sourcegen: language-neutral API for source code generation, replacement for Lombok - Micronaut Serialization: doesn’t use reflection and allows using common annotation models including Jackson annotations, JSON-B annotations or BSON annotations - Micronaut Langchain4j: thin layer over langchain4j
Internal 6 GraalVM - High-performance JDK distribution - Increases application throughput, reduces latency, reduces memory use - Graal just-in-time (JIT) compiler that runs on top of HotSpot, written in Java - native-image ahead-of-time (AoT) compiler compiles Java applications into small self-contained native binaries
Internal 8 GraalJS, GraalPy and GraalWasm - Open Source, maintained by GraalVM team - Can run on any OpenJDK distribution - Faster on GraalVM (using Graal compiler) - Supports native image - Plugins for Maven and Gradle
Internal 14 Pros and Cons Microservices • ± Independent processes • - Inter process communcation overhead • - Data copy / synchronization / file I/O • + Free to use language runtime for each service Embedded Graal Languages • + All-in-one process, simple deployment • + Low-overhead calls between languages • + Direct data sharing • - Limited to available runtimes and versions of Graal languages • - Native libs sometimes hard to support
Internal 15 Threading model • Python has a single thread execution lock • Multiple threads in Java → have to wait for lock – Simple but low throughput • Solution: context pooling (each context is independent) • Beware: not compatible with some Python native libraries!
Internal 16 So what’s the catch? • Many Python libraries are actually native (C) • Need to recompile Python packages • Can be slow, or sometimes fail (e.g no Tensorflow for now) • Team is working on precompiled wheels (published to Maven Central or something else)
Internal 17 Compatibility • Supports Python 3.11 (3.12 in progress) • Easy upgrade from Jython • Compatible with the top 500 packages on PyPi – See graalvm.org/python/compatibility • Native extensions have to be rebuild from source