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 2023/01/09 20:05:56 UTC

[daffodil] 03/04: Store the prefix string in ElementRuntimeData instead of a def

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

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

commit af81c4ccc647fb470104c082fa714c431bd2092d
Author: Steve Lawrence <sl...@apache.org>
AuthorDate: Thu Jan 5 14:56:41 2023 -0500

    Store the prefix string in ElementRuntimeData instead of a def
    
    Looking up the prefix shows up in profiling. There's no need to relook
    it up everytime, so just store it as a lazy val.
    
    DAFFODIL-2400
---
 .../src/main/scala/org/apache/daffodil/processors/RuntimeData.scala   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/RuntimeData.scala b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/RuntimeData.scala
index 005979e7a..af4a43997 100644
--- a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/RuntimeData.scala
+++ b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/RuntimeData.scala
@@ -632,9 +632,9 @@ sealed class ElementRuntimeData(
 
   def isComplexType = !isSimpleType
 
-  def prefix = this.minimizedScope.getPrefix(namedQName.namespace)
+  lazy val prefix = this.minimizedScope.getPrefix(namedQName.namespace)
 
-  def prefixedName = {
+  lazy val prefixedName = {
     if (prefix != null) {
       prefix + ":" + name
     } else {