Skip to content

nzuguem/java-native-compilation-workshop

Folders and files

NameName
Last commit message
Last commit date
Mar 23, 2025
Oct 18, 2024
Mar 23, 2025
Dec 22, 2023
Sep 26, 2024
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Oct 17, 2024
Dec 29, 2023
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Mar 23, 2025
Dec 14, 2023
Sep 26, 2024

Repository files navigation

Native compilation workshop in Java

Quarkus Application CI/CD Workflow Spring Boot CI/CD Workflow Quarkus Application CLI CI Workflow

Click the button below to start a new development environment:
Open in Gitpod

Measurement considerations

⚠️ All measurements are highly dependent on the characteristics of my computer. So feel free to replay the commands to make up your own mind.

We use the time command to measure performance (execution time and memory consumption).

The use of this command differs depending on whether you're running MacOS or Linux :

  • MacOS
$ TIMEFMT+=' %M kb rss'
$ time <COMMAND>
#0,00s user 0,00s system 0% cpu 1,014 total 1168 kb rss
  • Linux
$ /usr/bin/time -f "%E real,%U user,%S sys, %M kb rss" <COMMAND>
#01.03 real,0.00 user,0.00 sys, 1648 kb rss

In the output of the time command, there are 2 elements of interest to us :

  • Program execution time (real or total) -> <VALUE> real or <VALUE> total

Startup Time = Program Execution Time - Solution Time

  • Solution Time : Time taken for user code to be executed
  • Program Execution Time: Total program run time (runtime startup time + Solution Time)
  • Memory consumption of the executed program -> <VALUE> kb rss

Content

  1. Basic compilation in Java πŸ‘‰πŸΌ How the JIT Compiler works
  2. GraalVM JIT Compiler πŸ‘‰πŸΌ Installing and testing GraalVM JIT
  3. GraalVM AOT Compiler πŸ‘‰πŸΌ Discover the Ahead Of Time (AOT) compilation with GraalVM
  4. Spring Boot Native - AOT πŸ‘‰πŸΌ Discover the Ahead Of Time (AOT) compilation with Spring Boot + GraalVM
  5. Quarkus Native - AOT πŸ‘‰πŸΌ Discover the Ahead Of Time (AOT) compilation with Quarkus + GraalVM