Future plans for AppCDS?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Future plans for AppCDS?

Mike Hearn
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.
Reply | Threaded
Open this post in threaded view
|

Re: Future plans for AppCDS?

David Holmes
Hi Mike,

On 5/08/2015 4:23 AM, Mike Hearn wrote:
> Hi there,
>
> I'm wondering if there are any plans to extend AppCDS in future to include
> serializing the code cache to disk?

The are no existing Projects or JEPs in this area.

Cheers,
David
------

> 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.
>
Reply | Threaded
Open this post in threaded view
|

Re: Future plans for AppCDS?

Volker Simonis
In reply to this post by Mike Hearn
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 <[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Future plans for AppCDS?

Vladimir Kozlov
Here is very good and detailed blog about what you can do with AppCDS and AOT:

https://mjg123.github.io/2017/10/04/AppCDS-and-Clojure.html

Regards,
Vladimir

On 11/28/17 2:03 AM, Volker Simonis wrote:

> 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 <[hidden email]> 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.