[ https://issues.apache.org/jira/browse/DAFFODIL-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16958818#comment-16958818 ]
Steve Lawrence commented on DAFFODIL-2222: ------------------------------------------ Taking a brief look, we have the line in the base InfosetInputter class, that is doing just what you say and creating a new DaffodilTunables object on construction: {code:scala} var tunable = DaffodilTunables() {code} But on unparse, we always call {code:scala} infosetInputter.initialize(...) {code} which always replaces the tunable with the one from the DataProcessor (which has already been allocated and initialized). So the one that we create is never actually used, making that overhead completely unnecessary. Probably the right fix here is to just replace the declaration of the tunable var with this: {code:scala} var tunable: DaffodilTunables = _ {code} Effectively initializing it to null and relying on the {{initialize}} method to set it. > InfosetInputter cached DaffodilTunables > --------------------------------------- > > Key: DAFFODIL-2222 > URL: https://issues.apache.org/jira/browse/DAFFODIL-2222 > Project: Daffodil > Issue Type: Improvement > Components: Performance > Affects Versions: 2.4.0 > Reporter: Michael Miller > Priority: Minor > > Is it possible to allow the {{InfosetInputter,}} and subclasses, to have a > {{DaffodilTunables}} object pre-created passed into its constructor? > When profiling unparse performance, some class/resource loaders do not handle > the {{DaffodilTunables}} initialization very well. In particular, if your > using a container like Wildfly, the ModuleClassLoader is very inefficient, > and hits disk io heavily, during the \{{getResource("/daffodil-config.xml")}} > that happens for every single {{InfoSetInputter}} construction. > Is it necessary to have a newly generated {{DaffodilTunables}} everytime an > unparse is called? > If the above is not possible, is there a way to reuse {{InfosetInputter}} > objects and reset them for repeated calls to avoid the {{new > DaffodilTunables()}} overhead? -- This message was sent by Atlassian Jira (v8.3.4#803005)