$30 off During Our Annual Pro Sale. View Details »

Fight cold startup times for Kotlin lambdas with GraalVM

Fight cold startup times for Kotlin lambdas with GraalVM

In a live-coding session we'll see how a Custom Runtime can be implemented in Kotlin and how we can run our application as a native image that we create with the help of GraalVM.

by Mathias Düsterhöft
presented on May 2, 2019 @car2go

More Decks by Kotlin User Group Hamburg

Other Decks in Programming

Transcript

  1. FIGHTING COLD STARTUP ISSUES FOR YOUR KOTLIN LAMBDA WITH GRAALVM

  2. None
  3. COLD STARTUP

  4. WHAT IS COLD STARTUP

  5. COLD STARTUP AND THE JVM What is happening during JVM

    startup? JIT compilation garbage collection class loading static initialization ...
  6. COLD STARTUP AND THE JVM Yan Cui - aws lambda

    – compare coldstart time...
  7. AWS re:Invent 2018: [REPEAT 1] Inside AWS: Technology Choices for

    Modern Applications (SRV305-R1)
  8. GRAALVM

  9. GRAALVM  For existing Java applications, GraalVM can provide benefits

    by running them faster, ... creating ahead- of-time compiled native images. - https://www.graalvm.org/docs/why-graal/
  10. GRAALVM - NATIVE IMAGES GraalVM can create native images for

    existing JVM- based applications native image generation employs static analysis to find any code reachable from the main Java method the reachable code is then compiled AOT into machine code the resulting executable is self-contained (contains VM components)
  11. GRAALVM Codrut Stancu - Instant Netty Startup using GraalVM Native

    Image Generation
  12. CUSTOM AWS LAMBDA RUNTIMES

  13. None
  14. CUSTOM AWS LAMBDA RUNTIMES open up AWS Lambda for any

    programming language a runtime is a program that runs the Lambda handler can be included in the deployment package
  15. CUSTOM AWS LAMBDA RUNTIMES

  16. DEMO

  17. SHOW ME THE NUMBERS Observed cold startup times

  18. CONCLUSION GraalVM native images greatly reduce startup time native image

    also seem to improve runtime performance creating native images for an application is cumbersome native image generation is slow
  19. Questions?

  20.    https://gitpitch.com/mduesterhoe /kotlin- graalvm-custom-aws-lambda-runtime-talk mduesterhoe /kotlin-graalvm-custom-aws- lambda-runtime-talk Blog:

    Fighting cold startup issues for your Kotlin Lambda with GraalVM
  21. THANK YOU!