Alright, getting rid of document_order_first() and the xpath crate too reduced parsing time from >5 min to ~3 seconds :D
-
-
Replying to @CryZe107
https://github.com/shepmaster/sxd-xpath/blob/16b17d775ef9654abc0943f804bc6f7833a3049a/src/nodeset.rs#L349-L351 …. Is it possible to get a link to the XML and XPath in question? An issue would be wonderful.
1 reply 0 retweets 0 likes -
Replying to @JakeGoulding
Here's the XML: https://splits.io/pt9/download/livesplit … The thing is that I wasn't actually using XPath normally. I was just using it to
1 reply 0 retweets 0 likes -
Replying to @CryZe107 @JakeGoulding
access certain child elements, so the XPaths where all just names of single child elements I wanted to access.
1 reply 0 retweets 0 likes -
Replying to @CryZe107 @JakeGoulding
If you want you can try to open the file with the old parser to figure out why it's so slow: https://github.com/CryZe/livesplit-core/tree/07d3c41b4e06853e64efbfa4c4bb9fc5b12ccfe1 …
1 reply 0 retweets 0 likes -
Replying to @CryZe107 @JakeGoulding
You can use this crate (with this hash) to parse the file I provided. To parse use livesplit_core::parser::livesplit::parse.
1 reply 0 retweets 0 likes -
Replying to @CryZe107
Oh dear, were you recompiling the XPath inside of a loop?
1 reply 0 retweets 0 likes -
Replying to @JakeGoulding
yeah that too ^^' after replacing document_order_first with .iter().next() it already was super fast tho even with recompiling
4 replies 0 retweets 0 likes -
Replying to @CryZe107
Yeah, that's what I just realized. Since you are expecting a single node, it definitely doesn't matter what order the nodes are in
1 reply 0 retweets 0 likes -
Replying to @JakeGoulding
Maybe add a note in the documentation that it's faster to use .iter() if document order is not needed.
1 reply 0 retweets 0 likes
Not a bad idea. I do still want to cache the computation of the ordering though.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.