You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/01/05 17:59:10 UTC
[GitHub] [daffodil] mbeckerle commented on a change in pull request #721: Support --infoset null for CLI unparsing
mbeckerle commented on a change in pull request #721:
URL: https://github.com/apache/daffodil/pull/721#discussion_r779024957
##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/NullInfosetInputter.scala
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.infoset
+
+import java.io.InputStream
+
+import scala.collection.mutable.ArrayBuffer
+
+import scala.xml.Elem
+import scala.xml.Node
+import scala.xml.SAXParser
+import scala.xml.Text
+import scala.xml.XML
+
+import org.apache.daffodil.dpath.NodeInfo
+import org.apache.daffodil.infoset.InfosetInputterEventType._
+import org.apache.daffodil.util.MaybeBoolean
+import org.apache.daffodil.xml.DaffodilSAXParserFactory
+import org.apache.daffodil.xml.XMLUtils
+
+object NullInfosetInputter {
+
+ case class Event(
+ eventType: InfosetInputterEventType,
+ localName: String = null,
+ namespaceURI: String = null,
+ simpleText: String = null,
Review comment:
Similarly, the simpleText conversion into the binary simple data type is overhead we would not have if we were using our own serialization form, because the ERD would tell us exactly the simple type, so we could store the binary value.
I am less worried about this overhead than the nextElementErd() overhead however. But still if we have fine-enough granularity timers, we could time the conversion of the simple value from string to our value object that is stored in the DISimple node, and then that overhead could be excluded (or counted as part of serialization overhead.)
##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/NullInfosetInputter.scala
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.infoset
+
+import java.io.InputStream
+
+import scala.collection.mutable.ArrayBuffer
+
+import scala.xml.Elem
+import scala.xml.Node
+import scala.xml.SAXParser
+import scala.xml.Text
+import scala.xml.XML
+
+import org.apache.daffodil.dpath.NodeInfo
+import org.apache.daffodil.infoset.InfosetInputterEventType._
+import org.apache.daffodil.util.MaybeBoolean
+import org.apache.daffodil.xml.DaffodilSAXParserFactory
+import org.apache.daffodil.xml.XMLUtils
+
+object NullInfosetInputter {
+
+ case class Event(
+ eventType: InfosetInputterEventType,
+ localName: String = null,
Review comment:
Can we exclude the overhead of nextElementErd() by timing it separately allowing us to include it, or exclude it from what we're counting?
The fact that the serialized XML or JSON or whatever doesn't exactly identify the ERD for us is overhead related to the serialized form. (If we invented our own serialized form we would put an unambiguous ERD identifier in the serialized form, so that there would be no nextElementErd() overhead. )
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org