Description
TL;DR
The current reflection in Native Image requires metadata entries for each query on java.lang.Class
instances. For example, calling clazz.getDeclaredMethods()
will require a JSON entry "allDeclaredMethods": true"
for that class. This fine-grained approach can be cumbersome as it yields many entries in reflection metadata.
We will investigate the impact of including metadata of all java.lang.Class
members for classes registered for reflection. This would include names and signatures of all methods, properties of all fields, and all annotations.
The impact will be evaluated on, Spring Petclinic, Micronaut Shopcart, and a few prominent metadata-repository projects. The following metrics will be taken into account: Max RSS, Startup time, Image Size, and the number of required metadata entries.
Goals
- Evaluate if we can reduce the amount of required metadata without noticeably increasing the image size.
- Improve statistics collection for reflection metadata.
Non-goals
- Change reflection metadata to bloat the produced native images.
- Change JNI, Serialization, or dynamic proxies.
- Include bodies of all methods into the reflection metadata.
Metadata
Metadata
Type
Projects
Status