[ 
https://issues.apache.org/jira/browse/DAFFODIL-2831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17805612#comment-17805612
 ] 

Mike Beckerle commented on DAFFODIL-2831:
-----------------------------------------

[[email protected]] an easy version of this to optimize is one where the child 
elements of a choice (with initiatedContent="yes") all have single 
dfdl:initiator values that are just uniform tokens, i.e., all the same length, 
with no %WSP*; or anything like that.  

Will that be sufficient for the use cases that motivated this ticket, or is 
something more general required? 

The issue is if the various initiators are all distinct, but are different 
lengths, then the runtime algorithm must proceed carefully. It can't assume 
that the number of characters are available corresponding to the length of the 
longest initiator, because one of the choice branches might have a very short 
initiator followed by very short data that is shorter than the length of one of 
the other initiators. I think we can only grab the initiator and turn this into 
a constant time dispatch if all the initiators are the same length, and are 
just constant strings of literal characters. (%SP; and other entities that 
stand for single characters would also be allowed.)

So the question is: with that restriction (all initiators same length), is that 
going to work for the use case?

> InitiatedContent performance isn't equivalent to choicedispatchkey performance
> ------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2831
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2831
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Middle "End"
>    Affects Versions: 3.5.0
>            Reporter: Olabusayo Kilo
>            Priority: Major
>
> One should achieve similar performance by an optimization of 
> initiatedContent="yes". Having to do a by-hand optimization/workaround of 
> choiceDispatchKey, with the corresponding ugly outputValueCalc, is definitely 
> to be avoided.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to