Open
Description
Magnitude
🔴 HIGH
Consumed samples (~): 202s
Memory allocation (~): 10.14MB
Description
All property mappers are initialized in the static block, which is quite time-consuming and additionally, the memory allocation is also quite high.
Mitigation
Do not initialize all property mappers, when it's not needed. These are used only in the startup based on the configurations found from various sources (CLI, ENV, properties,...). We could lazily initialize them when the specific mapper is needed and cache it to the memory if necessary. Some kind of Map<String, Supplier<PropertyMapper>>
might be suitable for this scenario. When the option name matches the property mapper, the particular mapper will be initialized.
Might be connected to #27025.