Optimize XML parsing

Using XPath expressions appears to be expensive so that has been
replaced with direct child node access. This seems to have improved
performance by 5%.

A side effect of this change is that XML_IGNORE_NAMESPACE option is
no longer needed as namespaces are ignored by default.
This commit is contained in:
Zaid Abdulla committed 2018-09-08 23:49:34 -07:00
1 parent 037aa9786d
commit ec215ffb82
2 files changed
+293 -175

No files matched your search

-4
View File
@@ -79,7 +79,6 @@ const options = {
XML_FORMAT: { type: "bool", default: false },
XML_NO_DECL: { type: "bool", default: false },
XML_NO_EMPTY: { type: "bool", default: false },
XML_IGNORE_NAMESPACE: { type: "bool", default: false },
// Should probably never be changed
DEVICE_ONLINE_THRESHOLD: { type: "int", default: 4000 }
@@ -106,9 +105,6 @@ function setConfig(name, value, commandLineArgument) {
)
setConfig("GPV_BATCH_SIZE", value);
if (name === "IGNORE_XML_NAMESPACES" || name === "ignore-xml-namespaces")
setConfig("XML_IGNORE_NAMESPACE", value);
if (name === "XML_PARSE_IGNORE_ENC" || name === "xml-parse-ignore-enc")
setConfig("XML_IGNORE_ENC", value);