Skip to content

Reevaluate the impact of requiring metadata entries for each class member query #7753

Closed
@vjovanov

Description

@vjovanov

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

  1. Evaluate if we can reduce the amount of required metadata without noticeably increasing the image size.
  2. Improve statistics collection for reflection metadata.

Non-goals

  1. Change reflection metadata to bloat the produced native images.
  2. Change JNI, Serialization, or dynamic proxies.
  3. Include bodies of all methods into the reflection metadata.

Metadata

Metadata

Type

No type

Projects

Status

Released

Relationships

None yet

Development

No branches or pull requests

Issue actions