[–] lazystone 16 hours ago
[–] crschnick 15 hours ago
[–] florieger 15 hours ago
IMHO, that would be much better than running into crashes and having to figure out the cause yourself.
[–] ahartmetz 33 minutes ago
[–] odo1242 13 hours ago
[–] jayd16 14 hours ago
[–] paulddraper 15 hours ago
"This is what I would like AOT cache to mean."
[–] pron 15 hours ago
The first use case is the very common one (for Java) where developers control deployment (internal deployment). The last basic building block, caching machine code, will be released next year in JDK 28, and then the feature is likely to evolve to better support other use cases, such as external deployment.
[–] jbellis 14 hours ago
[–] samus 5 hours ago
[–] pjmlp 14 hours ago
There are plenty of other AOT/JIT cache approaches in the Java ecosystem already, with more mature deployment experience of several years, namely:
OpenJ9, Azul, PTC, Aicas, the Android cousin since Android 7
Technology based on process snapshots CRaC for Amazon OpenJDK distro (Correcto), and OpenJ9, is also another approach available for some time.
[–] switchbak 9 hours ago
All in all, I wasn't particularly impressed with the outcome. Obviously GraalVM has more headroom, but that's an even more intrusive change.
When compared with a Rust port of our service, the delta of the efforts is absolutely astronomical. Ridiculous performance, near-instant startup, radically less memory consumption. I mean - duh - but nonetheless, when I contrast the effort vs payback, it's very hard for me to want to invest so much in techniques that have so little payback (graal) when I can put that into an approach that leaves me in a much better place long-term.
If I had mountains of legacy, obviously I couldn't do that, but in my situation it seems like a much more attractive option.
[–] sideeffffect 7 hours ago
It seems like your use case is rather not a good fit for Java.
Java shines best with large applications, where more abstract source code is desired and when you care more about typical performance, not the worst case performance. And if you can afford the cost of all those benefits, which is higher RAM usage.
At least that's the theory :)
[–] ahartmetz 26 minutes ago
[–] deepsun 15 hours ago
I think other AOT-compiled languages don't opt in for the lowest set of CPU features -- they just detect them at runtime and use whenever present, all in compiled machine code.
[–] mikepurvis 15 hours ago
https://doc.rust-lang.org/beta/core/arch/#dynamic-cpu-featur...
[–] _old_dude_ 15 hours ago
[–] emoII 15 hours ago
[–] hocuspocus 15 hours ago
Struggling to build native images should be a sign you're reliant on libraries that are dangerously outdated and abandoned.
[–] jcurtis 13 hours ago
[–] emoII 13 hours ago
[–] crschnick 12 hours ago
The AOT cache compatibility issues come when your boot module path differs between training and actual run. As long as that is not the case, you can use it without problem and load additional modules at runtime after it has started up.
With GraalVM, that is not possible. It still has the closed-world assumption.
[–] smrtinsert 10 hours ago
[–] emoII 9 hours ago
[–] jiehong 15 hours ago
Instead, this AOT feature is not very ergonomic to use at all, with too many pitfalls to be of broad use IMO.
[–] JMKH42 16 hours ago
[–] pron 15 hours ago
[–] zbentley 11 hours ago
There also might be a need for "downgrading" cross-compilation profiles a la "don't compile/AOT-cache this app for the current CPU, compile/cache it for <the kind of CPU that I have 10k EC2 instances running>". You'd think that would be easier to achieve by just compiling on a production-like machine, and you'd be disappointed by the number of shops running Java apps hand-built on a Windows laptop across millions of cloud Linux cores.
[–] Tostino 3 hours ago
[–] pregnenolone 12 hours ago
[–] wokkel 12 hours ago
[–] pregnenolone 8 hours ago
Deployment of Java applications continues to be a mess to this day. You can't get anywhere without obscure Maven or Gradle plugins and even then it's a mess, especially if you're dealing with modules and jlink. Actually, using jlink without these broken plugins is the closest thing to hell. I'm not even going to elaborate further because I've explained this many times (https://news.ycombinator.com/item?id=47423383).
Golang's or especially Rust's tooling on the other hand are simply beautiful. Even .NET is fine now.
[–] sideeffffect 7 hours ago
If it could help you, we're using JIB. We're on Scala and so we're using sbt-jib. Zero issues, works like a charm, deployment (on k8s) is just not a problem for us. But I would expect that it should work well for Java too.
[–] robotnikman 12 hours ago
[–] zbentley 11 hours ago
Server-Side/Desktop JavaScript, I think, has a much better/more polished deployment experience than Java...at the cost of having a much worse build (ES module hell, bundler hell...) and maintenance (dependency hell, security hell, constantly changing APIs hell...) experience than Java, which excels at both of those.
https://openjdk.org/jeps/544
> Non-Goals
> It is not a goal to support cross-compilation. Code compiled in a training run must run on the same CPU architecture, with the same set of features, in subsequent production runs.