Details
-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
Low
Description
As a way to combat aggressive class initialization, WFCORE-1841 added a variant method to ExtensionParsingContext which allowed a supplier of a parser to be provided.
This has resulted in an explosion of lambda usage; around 150 calls to this method exist, most of which supply constructor references as the Supplier argument.
We can theoretically save considerable metaspace by doing one of the following:
- Add a variation of the method which accepts a Class instead of a Supplier; it uses Class.newInstance() or Class.getConstructor().newInstance() to instantiate the parser on demand
- Create a reflective Supplier implementation which, given a Class, uses it in this way to construct instances
Performance impact should be very minimal, as the overhead of calling a constructor is less than that of compiling a method reference, and the overhead in metaspace is nearly non-existent in comparison.
Attachments
Issue Links
- relates to
-
WFCORE-1861 Subsystem parsers should be created lazily when needed
- Resolved