mbeckerle commented on a change in pull request #259: Incremental progress on
schema compilation space/speed issue.
URL: https://github.com/apache/incubator-daffodil/pull/259#discussion_r301239335
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ModelGroup.scala
##########
@@ -57,41 +58,54 @@ object ModelGroupFactory {
lexicalParent.schemaDefinitionError("Model group circular definitions.
Group references, or hidden group references form a loop.")
} else {
val moreNodesAlreadyTrying = nodesAlreadyTrying + child
+ val res = //
memoizedApply(child)(lexicalParent)(position)(isHidden)(nodesAlreadyTrying)
+ nonMemoizedApply(child, lexicalParent, position, isHidden,
nodesAlreadyTrying)
+ res
+ }
+ }
- val childModelGroup: ModelGroup = child match {
- case <sequence>{ _* }</sequence> => {
- val seq = new Sequence(child, lexicalParent, position)
- if (seq.hiddenGroupRefOption.isDefined) {
- //
- // construct the group ref XML, then recursively process that,
- // but set flag so it will be hidden.
- //
- val hgrXML = seq.hiddenGroupRefXML
- ModelGroupFactory(hgrXML, lexicalParent, position, true,
moreNodesAlreadyTrying)
- } else {
- seq
- }
- }
- case <choice>{ _* }</choice> => new Choice(child, lexicalParent,
position)
- case <group>{ _* }</group> => {
- val pos = lexicalParent match {
- case ct: ComplexTypeBase => 1
- case mg: ModelGroup => position
- case gd: GlobalGroupDef => position
- }
- val isH = isHidden || lexicalParent.isHidden
- val groupRefFactory = new GroupRefFactory(child, lexicalParent, pos,
isH)
- val groupRefInstance = groupRefFactory.groupRef
- groupRefInstance.asModelGroup
+ private lazy val memoizedApply =
Review comment:
Unused code. Remove and put back once we start really using it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services