6 comments

  • lazystone 45 minutes ago
    > In theory, the whole AOT cache idea sounds like something that should only affect the class data and not perform any native compilation

    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.

    • crschnick 5 minutes ago
      Your link is about a completely separate feature, called the AOT code cache (targeted for JDK28, not released yet). The post is about the AOT cache, which forms the foundation for this feature, but is separate and already available since JDK24. The JEP for the feature the post is about is https://openjdk.org/jeps/483
    • florieger 39 minutes ago
      I wonder if this should trigger a warning (or even an error) at application startup whenever the CPU architectures differ.

      IMHO, that would be much better than running into crashes and having to figure out the cause yourself.

    • paulddraper 16 minutes ago
      Yeah, there are some strange expectations going into this.

      "This is what I would like AOT cache to mean."

  • emoII 10 minutes ago
    What are the most common ways to improve warmup times, actually? Looked a bunch into this, primarily native image, aot and crac, all of them super messy to get to work with a normal JVM webapp. I understand the warmup concept is inherent in JIT compilation, but how are big companies like Netflix handling this to quickly scale microservices horizontally etc?
  • deepsun 32 minutes ago
    > What would be needed is some sort of compatibility switch that disables all optional CPU features. Sure, you will get some reduced performance of the compiled code, but in exchange, a faster startup time.

    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.

  • _old_dude_ 43 minutes ago
    The Inside Java podcast episode on AOT caching covers the issue in this segment:

    https://youtu.be/U2j4bKgKr-s?t=3577

  • jiehong 33 minutes ago
    When AOT came to be, I kinda hoped for GraalVM's solution would make it relatively as-is to open jdk.

    Instead, this AOT feature is not very ergonomic to use at all, with too many pitfalls to be of broad use IMO.

  • JMKH42 56 minutes ago
    I wonder if you could do the training run on install, so that each user gets a build tied to their specific cpu?