Awesome
Choose your XML
Crates
xml-rs | |
quick-xml | |
xml5ever | |
sxd-document |
Features
Feature/Crate | xml-rs | quick-xml | xml5ever | sxd-document |
---|---|---|---|---|
Document type definition | No | No | Partial | Partial |
Namespaces | Yes | Yes | ? | Yes |
Numeric character reference | Yes | Yes | Yes | Yes |
XML entity reference | Yes | Yes | Yes | Yes |
HTML entity reference | No | No | Yes | No |
DTD entity reference | No | No | No | No |
xml:space | No | No | No | No |
Non UTF-8 input | No | No | No | No |
XPath | No | No | No | Yes |
XQuery | No | No | No | No |
Event parser | Yes | Yes | Yes | No |
Push parser | No | No | Yes | No |
Error recovery | No | No | Partial | No |
DOM | No | No | Yes | Yes |
Writing | Yes | Yes | Yes | Yes |
You can test features by yourself using corresponding example:
cargo run --example crate_name file_path
# example
cargo run --example quick_xml data/small.xml
Performance
test quick_xml_large ... bench: 1,899,961 ns/iter (+/- 19,762)
test quick_xml_medium ... bench: 606,169 ns/iter (+/- 12,840)
test quick_xml_small ... bench: 6,861 ns/iter (+/- 337)
test sxd_document_large ... bench: failed
test sxd_document_medium ... bench: 2,556,833 ns/iter (+/- 53,307)
test sxd_document_small ... bench: 39,422 ns/iter (+/- 1,562)
test xml5ever_large ... bench: 8,318,061 ns/iter (+/- 38,335)
test xml5ever_medium ... bench: 7,403,966 ns/iter (+/- 39,070)
test xml5ever_small ... bench: 44,433 ns/iter (+/- 528)
test xmlrs_large ... bench: 26,283,106 ns/iter (+/- 155,005)
test xmlrs_medium ... bench: 13,513,665 ns/iter (+/- 15,710)
test xmlrs_small ... bench: 92,391 ns/iter (+/- 149)
You can run benchmarks by yourself using cargo bench
.
* Note that sxd-document
generates a whole DOM.
Contributing
Any suggestions and patches are welcome. Especially from crate authors.
License
This repo is licensed under MIT license.