Selective Ahead of Time Compilation using Annotations
I'm writing a music composition application.
Once compiled by the JIT, code runs at the speed I need to playback and highlight notes as they are played. That is, rendering takes 3 ms and painting takes 1ms. The first few dozen iterations, rendering takes 22 ms and painting 6 ms.
Interesting, the Hotspot VM has the JVMSPI_IsPrecompilationTarget available for embedded systems.
Why can't SUN create an annotation to precompile, Ahead-of-Time (AOT), certain methods and all the code called up its object chain? It could be done after class loading and before execution or, an alternate annotation could request that the VM run a low priority thread to compile it. Perhaps with a order priority number.For my application, users often edit scores while CPU cycles sit idle. Ideally, developpers could interact programmatically, receiving a listener event when compilation is done. For my app, if a user presses play and compilation isn't done, the developper could inform the user "preparing for play" and increase the thread priority or at least wait for the "compilation done" event before proceeding.I don't know why SUN hasn't added this to the Java language and VM reference implementation yet. It would make GCJ and Excelsior JET redundant.
The garbage collector is very well behaved at its low priority and because I use pools of permanent objects, reuse as much as possible. ( http://java.sys-con.com/read/37613.htm )
-XX:CompileThreshold=#is useless to me.
Unfortunately, Sun's Java Real Time environment is not available for Mac OS X.

