We initially used GraalVM Native Image as a way to deploy JavaFX to mobile targets. However, after seeing our mobile apps feel snappier than our desktop apps, we gradually migrated all of our GUI and CLI applications over to ahead-of-time (AOT) compilation. GUIs mostly run in interpreted mode (users would have to click thousands of times to reach the JIT threshold), and with AOT we see up to 90% reductions in startup and first visit times, which results in a noticeably better user experience.
Table 1. AtlantaFX sampler comparison on a Raspberry Pi 5 AtlantaFX Sampler (RPi5) jlink (JIT) jlink + CDS (JIT) Native Image (AOT)
Distribution size
139 MB
155 MB (+12%)
124 MB (-11%)
Time to first window
3.6 s
2.7 s (-26%)
0.5 s (-86%)
First visit: HTMLEditor (WebView)
2.39 s
2.31 s (-3%)
0.22 s (-91%)
First visit: Overview (FXML)
1.90 s
1.50 s (-21%)
0.32 s (-83%)
Private memory after startup
224 MB
244 MB (+9%)
164 MB (-27%)
Private memory after all pages
1424 MB
1396 MB (-2%)
634 MB…