Future plans for AppCDS?
Volker Simonis
volker.simonis at gmail.com
Tue Nov 28 10:03:04 UTC 2017
Hi Mike,
what you are actually asking for is support for AOT (Ahead Of Time
compilation) [1].
It is already available in Java 9. Although the support for user code
is still experimental you should definitely give it a try.
Regards,
Volker
[1] http://openjdk.java.net/jeps/295
On Tue, Aug 4, 2015 at 8:23 PM, Mike Hearn <hearn at vinumeris.com> wrote:
> Hi there,
>
> I'm wondering if there are any plans to extend AppCDS in future to include
> serializing the code cache to disk?
>
> I ask because I have a (not very complicated) desktop JavaFX app. It starts
> in about three seconds, which isn't terrible, but I'd like it to be faster.
>
> Unfortunately I am frequently frustrated in this goal. Some testing shows
> that one step of the initialisation sequence takes about a second normally.
> If I put it in a loop to let it fully compile, that drops to more like a
> quarter of a second.
>
> Likewise, my app loads a series of items to display them on the screen. The
> first one can take a solid 700-800 msec. The rest are more like 10% of that.
>
> I tried parallelising some of the things done during startup, but it made
> no difference. My theory is that the compile threads are taking up the
> spare cores that could be doing startup tasks (it's a bit hard to profile
> this though as the whole sequence only lasts a few seconds).
>
> AppCDS already knows how to serialise lots of HotSpot state to disk for
> unchanging JARs. If it could store compiled method code as well, then I
> could probably shave a second or two off app startup.
>
> I do understand that this situation is a bit rare for Java developers and
> that due to extra disk IO etc, loading compiled code from disk might not
> always be faster. But for devices that have an SSD it probably can be,
> especially if HotSpot were to do the same trick Microsoft does and lay out
> compiled methods on disk in the order they will be used.
More information about the hotspot-runtime-dev
mailing list