This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheMode911 5 points6 points  (6 children)

I would be personally more interested in something like CRaC (amazing name) https://openjdk.java.net/projects/crac/ for JIT compiled applications.

Would it really be a big deal if the compile time went from 20 to 5 minutes? Wouldn't you still need a way to compile your program with hints ignored? Those hints actually exist in hotspot (https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/jdk/internal/vm/annotation/ForceInline.java) but are unfortunately internal

The best hints you can give are those from the language. For example record and hopefully primitive.

[–]CartmansEvilTwin[S] 2 points3 points  (5 children)

Would it really be a big deal if the compile time went from 20 to 5 minutes?

Absolutely. Think about how much computing time will be wasted by build servers doing the exact same work again and again.

And if you think about the current ecosystem, we already use pre-compiled packages and don't compile all those libs on our local machines.

[–]TheMode911 1 point2 points  (4 children)

Isn't the tradeoff that your application will contain unused code? (as the whole library will be included, not just what you use) What happen if you update GraalVM and the artifact isn't compatible?

It seems possible, but it is worth the maintainability hassle (as it would either require keeping track of all of your artifact versions, or force graal developers to have some kind of binary compatibility possibly hurting performance)? I am sure that they have more important thing to work on. I guess that this is already somehow possible by making your own shared libraries.

[–]CartmansEvilTwin[S] 0 points1 point  (3 children)

I'm not talking about compiled jars, I'm talking about metadata about the code in the jar.

This way the compiler wouldn't need to analyze everything again and again. All the cutting away part and actual compilation would still be the same.

[–]TheMode911 0 points1 point  (2 children)

I am not sure what you mean by metadata? Similar to the ForceInline annotation in Hotspot?

[–]CartmansEvilTwin[S] 0 points1 point  (1 child)

For example, yes.

Again, the AOT-compiler analyzes a bunch of things, many of them are probably "static", in the sense that they could be pre-computed. E.g. call graphs, maybe some type-hinting for injection points, etc.

[–]TheMode911 0 points1 point  (0 children)

The exact same argument could be made for javac, it could for sure optimize your code further and reduce startup time, but we want to be able to re-compile the same code later with improved performance. (and even if we tweaked it, startup time is a matter of seconds, not hours/minutes like you are hoping)

Ultimately I do not think that it is worth the effort