Would "java -Xshare:dump" speed up kotlin?

From the page:

The primary motivation for including CDS in Java SE is the decrease in startup time it provides. CDS produces better results for smaller applications because it eliminates a fixed cost: that of loading certain core classes. The smaller the application relative to the number of core classes it uses, the larger the saved fraction of startup time.

… that sounds perfect for kotlin-stdlib-jdk8 libs! Small overhead classes that always needs loading. Is there a way to include kotlin in the cache? It was unclear if you could add your own to the cache.

I propose you two more JEPs

https://openjdk.java.net/jeps/310
http://openjdk.java.net/jeps/341

Regarding Kotlin lib you do not consider it as a special case, many libraries can be shared between applications.
Moreover, many methods are inlined, so this feature cannot be applied (for this methods on that library).

I use the AdoptOpenJDK 12 and it works well with defaults.

1 Like

Cool, thanks for the pointers!