forked from yaronn/xpath.js
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
XPath versions: 23, 24, 27.
Selecting from large file (~70000 records) takes about 3 minute. All this time the thread is stuck.
bigxmlfile.xml.zip
document = new Dom().parseFromString(strfile);
let ts = xpath.select("//*[local-name()='t' or local-name()='tab' or local-name()='br' or local-name()='p' or local-name()='si']", document);
The most time is spent in the cycle in this function:
XNodeSet.prototype.buildTree = function () {
if (!this.tree && this.nodes.length) {
this.tree = new AVLTree(this.nodes[0]);
for (var i = 1; i < this.nodes.length; i += 1) {
this.tree.add(this.nodes[i]);
}
}
return this.tree;
};
Metadata
Metadata
Assignees
Labels
No labels