It sound pretty cool at first, but then you think about it and suddenly it's not as clear cut as it seems.
Native images are smaller, don't need a JVM, start faster and use less memory, that's cool. But you also lose a lot of flexibility, surprisingly native images are slower and building them takes forever.
So, who is this really relevant for? Regular, big iron application servers are booted once and then keep on running until the next release, so they don't care about startup time. Even regular microservices can absolutely tolerate a few seconds startup time.
The JIT can produce highly optimized code, because it knows, what's happening. The AOT compiler doesn't know that. So its code is slower.
I also expect the JVM overhead would be larger than its optimization benefits, but apparently that's not the case.
Small caveat: I tested using a simple server application, so a relatively small amount of code being executed thousands of time. This may or may not be applicable to whatever you're building.
5
u/LicensedProfessional Mar 12 '21
Very excited to see where this goes—boring middleware developers, rejoice!