-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance is not comparable to other XML parsing libraries #126
Comments
Thanks! Indeed, I did not invest heavily to the performance improvements yet. My goal is to provide a standards-compliant parser first. However, I'm not really surprised that libxml2 and Apple's implementations are faster :) After all, they are written in C, and at least libxml2 is bound to be heavily optimized manually. |
Thanks for making this crate, we've got a lot of miles out of it in Rusoto. 👍 Any thoughts on how best to contribute to improving performance of |
@matthewkmayer I see several directions for optimization.
Other than that, unfortunately, I don't have any pointers. I really suck at performance optimizations :( For example, I'd suspect that it may be possible to use SIMD operations, because I heard that other parsers like for JSON can get a lot out of it, but I don't know for sure, since I have never investigated this field. Ideally, the first step should be revamping the API so it no longer allocates that much. Supporting encodings other than UTF-8 should likely be a part of it, because I think that integration of encoding handling could affect the design significantly. There are beginnings of what I want to do in the "parser-rearchitecture" branch, but I'm afraid I don't have enough time to work on it right now. |
I don't know how to ask these questions exactly, but I'll try anyway. Please forgive my bluntness. What does or should Is it worth redesigning I want to emphasize that I have the utmost respect for your work, whatever the answer to the questions above. |
@scottlamb I'm out of the Rust ecosystem for a long time already, so I don't know the state of other crates, unfortunately. Last time I checked, none of the other XML crates were focused on getting full compliance with the XML spec or even declared that to be their goal ( Unfortunately, unless someone else is willing to take over maintenance, |
Thanks! I'll look into |
I'm back. :-/ I took a look at the other crates and didn't see anything more promising than
For my current use case (configuring IP cameras via ONVIF), I don't really need high performance. This is control plane stuff, not data plane stuff. So I think I'm going to stick with
fwiw, I'm willing to put in a little time if you'd find it helpful. You probably don't want to just hand the reigns over to me given that (a) you don't know me, (b) XML is sort of tangential to my projects rather than something I should be devoting a huge amount of time to improving the efficiency of. But I'd be happy to say author a PR when there's a severe bug, or take a first pass look at other PRs, etc. if that helps. |
Since Rust already has some XML parsers that are fast, but incomplete and/or inflexible, I think this crate could focus on conformance and ease of use instead. |
I build and maintain a library for parsing property list files in Rust, plist-rs, and I created benchmarks to compare it to the other common plist parsing libraries:
The XML property list parser in
plist-rs
is based onxml-rs
, and as you can see it is twice as slow as libplist which useslibxml
and four times as slow as NSPropertyListSerialization (Apple's implementation) which uses a custom XML parser.Just wanted to open this as a tracking issue to investigate where the issues are.
The text was updated successfully, but these errors were encountered: