Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Uwyn Logo
  1. Home
  2. RIFE2
  3. RIFE2 v1.3.0 with GraalVM native-image AOT compilation support

RIFE2 v1.3.0 with GraalVM native-image AOT compilation support

Scheduled Pinned Locked Moved RIFE2
1 Posts 1 Posters 94 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • gbevinG Offline
    gbevinG Offline
    gbevin
    wrote on last edited by
    #1

    RIFE2 v1.3.0 now supports Ahead-Of-Time compilation with GraalVM native-image, keeping your startup time and memory footprint low by doing the heavy lifting up-front.

    In order to try this out, please download the latest GraalVM JDK 19 distribution, and follow the steps to install native-image on your machine. https://www.graalvm.org/dev/reference-manual/native-image/

    Once that is done, package your application as an UberJar and create a single native executable using the following command:

    native-image --no-fallback --enable-preview -jar your-uber.jar
    

    You'll be able to launch it with:

    ./your-uber
    

    The RIFE2 bootstrap project is fully setup for AOT compilation, so you start there.

    Below is a screenshot and with statistics of a micro-benchmark I did on my AMD Ryzen 9 5950X 16 Core 128GB dedicated Linux server.

    Key points:

    • application startup in 3ms
    • standalone native executable size is 38MB
    • using siege locally with a concurrency of 10 x 2000 requests, gives ~33898 trans/sec
    • after the test, used up 281.7MB RES and 24.8MB SHR memory, account for 0.2% of memory

    220339696-24f1fcdd-dab2-4014-be42-81331d41c6ed.png

    In comparison, launching the Uber jar with the JVM:

    • application startup in 177ms
    • uber jar size is 4.7MB but requires a separate JVM installation
    • using siege locally with a concurrency of 10 x 2000 requests, gives ~44444 trans/sec
    • after the test, used up 1.7GB RES and 39.7MB SHR memory, account for 1.3% of memory

    NOTE: RIFE2 support for GraalVM native-image is still in preliminary stages. There's no solution yet to replace the features of the RIFE2 Java agent, and it's only been tested in a limited context. When expanding the code of the project, you most likely will have to update the native-image configuration files located in app/src/main/resources/META-INF/native-image.
    More information about that can be found in the GraalVM manual.

    1 Reply Last reply
    1
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups