You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by sl...@apache.org on 2018/01/19 19:27:05 UTC

[incubator-daffodil] branch master updated: Prepend rather than append when adding required evaluations to the root OOLAGContext

This is an automated email from the ASF dual-hosted git repository.

slawrence pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c3b495  Prepend rather than append when adding required evaluations to the root OOLAGContext
5c3b495 is described below

commit 5c3b495b9841dd975296323413fb4773380cbb2e
Author: Steve Lawrence <sl...@apache.org>
AuthorDate: Thu Jan 18 12:25:32 2018 -0500

    Prepend rather than append when adding required evaluations to the root OOLAGContext
    
    Setting the OOLAG context causes an append the required evaluations to
    the root requiredEvalFunctions list. Because it is an append, scala will
    make a copy of the requiredEvalFunctions list and append the items to
    that copy. For very large schemas with lots of Expressions (which calls
    setOOLAGContext), this can result in a huge amount of copies, resulting
    in large performance slowdowns during schema compilation. To prevent
    this, change the append to a prepend, which does not require a copy of
    the very large root requiredEvalFunctions list and will only copy the
    much smaller requiredEvalFunctions list from the child. This greatly
    reduces the copying and improves schema compilation time.
    
    DAFFODIL-1877
---
 .../src/main/scala/edu/illinois/ncsa/daffodil/oolag/OOLAG.scala         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/oolag/OOLAG.scala b/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/oolag/OOLAG.scala
index 3eab287..888ed0b 100644
--- a/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/oolag/OOLAG.scala
+++ b/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/oolag/OOLAG.scala
@@ -167,7 +167,7 @@ object OOLAG extends Logging {
         Assert.usageError("Cannot set oolag context more than once.")
       oolagContextViaSet = Some(oolagContextArg)
       if (oolagContext != OOLAGRoot) {
-        oolagRoot.requiredEvalFunctions ++= this.requiredEvalFunctions
+        oolagRoot.requiredEvalFunctions = this.requiredEvalFunctions ::: oolagRoot.requiredEvalFunctions
         this.requiredEvalFunctions = Nil
       }
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@daffodil.apache.org" <co...@daffodil.apache.org>'].