Skip to content

Instantly share code, notes, and snippets.

@tivrfoa
Last active September 25, 2025 09:48
Show Gist options
  • Save tivrfoa/2281c562646c41f930bbf9c945f23584 to your computer and use it in GitHub Desktop.
Save tivrfoa/2281c562646c41f930bbf9c945f23584 to your computer and use it in GitHub Desktop.
Java Quotes

AOT

https://x.com/shipilev/status/1970805877545505108

Aleksey Shipilëv @shipilev Timings get way better for any AOT mode when there are only a few available cores to run JIT in background. Once aggressive JIT compiler starts to compete with the application, it hurts a lot, and residency graphs are a mess. There are 2-3x wins, though. Oh man.

https://x.com/shipilev/status/1970948423710015888

Aleksey Shipilëv @shipilev Yeah, OpenJDK default compiler sizing policy is something like "log(N) * log(log(N)), but tiered policy also has a lot of feedback, including compiler load.

https://github.com/openjdk/jdk/blob/5d93242028dfc68b838a8efb0fbc4de3fea7fa0d/src/hotspot/share/compiler/compilationPolicy.cpp#L567

#ifdef _LP64
    // Turn on ergonomic compiler count selection
    if (FLAG_IS_DEFAULT(CICompilerCountPerCPU) && FLAG_IS_DEFAULT(CICompilerCount)) {
      FLAG_SET_DEFAULT(CICompilerCountPerCPU, true);
    }
    if (CICompilerCountPerCPU) {
      // Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n
      int log_cpu = log2i(os::active_processor_count());
      int loglog_cpu = log2i(MAX2(log_cpu, 1));
      count = MAX2(log_cpu * loglog_cpu * 3 / 2, min_count);
      // Make sure there is enough space in the code cache to hold all the compiler buffers
      size_t c1_size = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment