Slashdot Mirror


JIT vs AOT Compilation

jg21 writes "This article on "Penguin-Driven" JVMs takes a look the performance of Java GUI applications based on the JFC/Swing API, and contends that the JIT-powered JVMs can't match a JVM with an ahead-of-time compiler ported to the Linux/x86 platform. With AOT compilation, says the CTO who has written this piece, real-world Swing applications performed perceivably faster. One is left wondering, will we now see the 'microbenchmark war' carried into the Linux camp?"

10 of 57 comments (clear)

  1. What about dynamic compliation? by Muda69 · · Score: 4, Interesting

    IMO, this is the way to go. Dynamic compilation is a mix of interpretation and translation. It defers compilation for a body of code, until it believes that it will have an impact upon the runtime of the program. Dynamic compilation has the same benefits as JIT compilation, but mitigates the compilation times and pauses by limiting the amount of code it actually compiles. Additionally, dynamic compilation can take advantage of runtime characteristics of the program itself, allowing it to perform optimizations like monomorphic inlining. (Although it wouldn't be fair to elide the fact that AOT compilers could potentially make use of feedback/runtime profiling to achieve some of the same characteristics).

    1. Re:What about dynamic compliation? by mmusson · · Score: 3, Interesting

      One of the points in the article is that the JIT compilers did not do well with Swing code because it did not have hot spots. Any type of after the fact compile is not going to perform well if it can't identify the parts of the code that need to be compiled.

      --
      SYS 49152
  2. ibm's daisy by ophix · · Score: 3, Interesting

    doesnt ibm have a project named daisy that is a JIT vm running on top of the very machine it emulates?

    i seem to remember reading that they were able to achieve up to 25% performance increase by doing so (by taking advantage of run time profiling of the executable)

    i might be mistaken though

  3. Why Not Both? by RAMMS+EIN · · Score: 4, Interesting

    Why compare JIT against AOT? Why not have both?

    AOT compilation makes for fast start up time and fast run time. JIT advocates claim that it can lead to better performance, as more optimizations can be performed with run-time information. So why not combine the two? Compile it before the first run, and further optimize it at run-time where appropriate. That way, you get the best of both worlds.

    --
    Please correct me if I got my facts wrong.
  4. 1998 called by p3d0 · · Score: 5, Funny

    They want their idea back.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  5. Let me clarify by p3d0 · · Score: 4, Informative
    If you can show me a commercial JIT compiler that doesn't already do this, I'll eat my hat. What you call "dynamic compilation" is so routine and mundane that when people talk about "JIT compilers" these days, that is exactly what they are talking about. Nobody blindly compiles on the first invocation of a method any more.

    What you have mentioned is not the crux of the problem. I can't say much more because I do confidential work on IBM's JIT compiler.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    1. Re:Let me clarify by p3d0 · · Score: 5, Funny
      Yes, I have actually done this myself for x86 with my pet language's interpreter/compiler, so I'm not just talking out my arse.
      Oh, ok. For a moment there, I thought I was a professional JIT developer, but apparently I was mistaken.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  6. Re:What's the point in Java bytecode anyway? by p3d0 · · Score: 5, Informative

    It is parse trees. It's stack-based, which is pretty much just a post-order traversal of expression trees. Think of bytecode as a file format for describing expression trees.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  7. Re:Introspective behaviour by p3d0 · · Score: 3, Informative
    Think about usage patterns, maybe I am wrong but no actual VM execution model adapts program execution at running/history characteristics.
    Yep, I think you're wrong. Look up "value profiling" for instance. It means finding values that are effectively constant on a particular run of a program, and recompiling that program on the assumption that the value will indeed be constant.

    For instance, imagine the UNIX "wc" (word count) program were written in Java. An advanced JIT compiler could tell, for instance, that you have specified the "-l" option, and therefore you only need to count lines. The portions of the program that count letters and words would get removed as dead code, which probably speeds up the inner loop a great deal.

    Moden JIT compilers produce self-profiling code, and then re-compile with the profiling information to produce a specialized version of the code that will run faster under the current conditions.

    If that's not the "introspection" you're talking about, then perhaps I have misunderstood. Can you give an example?

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  8. Augh! Are they TRYING to drive me insane? by Sentry21 · · Score: 4, Funny

    When will the TLA madness end? Oh, the humanity! At least provide definitions, for those god-fearing folk who may be interested but not up-to-date.

    JVM: Java Virtual Machine, the virtual environment that every Java bytecode program runs within, abstracting real hardware for the program in question.

    GUI: Graphical User Interface

    JFC: Java Foundation Classes - the basic classes that are provided to developers upon which, or rather, with which, to build their programs.

    API: Application Programming Interface, a defined way for software to interface with other software (i.e. to make library calls)

    JIT: Just-In-Time compilation, compiles the program when it is being launched, for the machine it is being launched on, in order to prevent poor performance by compiling every instruction whenever it needs to be done

    AOT: Mentioned in the article text, it means Ahead of Time. For details, read the linked story.

    CTO: Chief Technology Officer. Name given to an executive in charge of new or current technology.

    Now that you know what is going on, RTFA.

    --Dan