Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-3466

Add reflection option to org.jboss.as.controller.parsing.ExtensionParsingContext

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Management
    • None
    • Low

      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.

              Unassigned Unassigned
              dlloyd@redhat.com David Lloyd
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: