[jboss-jira] [JBoss JIRA] (WFCORE-3466) Add reflection option to org.jboss.as.controller.parsing.ExtensionParsingContext

Brian Stansberry (JIRA) issues at jboss.org
Tue Dec 19 18:26:00 EST 2017


    [ https://issues.jboss.org/browse/WFCORE-3466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507274#comment-13507274 ] 

Brian Stansberry commented on WFCORE-3466:
------------------------------------------

Besides eliminating the cost of the Suppliers, we really want to get rid of the loading of the parser impl Class, and only load it if we actually encounter the namespace that demands it. 

> Add reflection option to org.jboss.as.controller.parsing.ExtensionParsingContext
> --------------------------------------------------------------------------------
>
>                 Key: WFCORE-3466
>                 URL: https://issues.jboss.org/browse/WFCORE-3466
>             Project: WildFly Core
>          Issue Type: Enhancement
>          Components: Domain Management
>            Reporter: David Lloyd
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list