Call for Discussion: New Project: Leyden

Mike Hearn mike at plan99.net
Tue May 19 14:07:33 UTC 2020


Although this may be veering into an unwanted "what will it be" discussion,
I'm curious how fundamental it is that an image must be either static or
dynamic.

HotSpot already does some speculative optimisations on the assumption that
new code isn't loaded e.g. the class hierarchy analysis. Speculative
optimisations do a great job of removing costs of dynamic language features
like class redefinition. Leyden seems to be proposed as a new 'mode' of the
Java language, but could it also be envisioned as a new set of
optimisations that optimistically assume no dynamic code loading? For
instance, could a module be marked as "available to dynamically loaded
code" and then the points-to analysis / dead code elimination would pin the
public API of the module before running, and if it's not marked as such,
then DCE runs across the boundaries too?

A big part of the SubstrateVM startup time win appears to come from a more
aggressive version of the AppCDS heap serialisation feature, and a general
focus on startup time to the exclusion of other factors (e.g. there's no
notion of module layers or module boundary enforcement). To what extent is
the closed-world assumption contributing to the footprint/startup time wins
vs other spec changes - is that known?

These questions aren't rhetorical, I don't have any view on the answers.
After playing around with native-image and seeing mixed results (e.g.
smaller wins than I thought for GUI JavaFX apps), and looking at the work
being done on AppCDS, I started to wonder if HotSpot can eventually match
the startup time and footprint wins of native-image without the
compatibility breaking changes SVM makes to get there, just through
doubling down on current optimisation techniques like jlink and speculation.

Thanks for any insight offered!


More information about the discuss mailing list