diff --git a/README.md b/README.md index db157a8..f596185 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,7 @@ For more details see [docs/parsing.md](https://github.com/RazrFalcon/roxmltree/b | Writing | | ✓ | ✓ | ✓ | | No **unsafe** | ✓ | | ✓ | | | Language | Rust | C | Rust | Rust | -| Size overhead4 | **~55KiB** | ~1.4MiB5 | ~78KiB | ~102KiB | -| Dependencies | **1** | ?5 | 2 | 2 | +| Dependencies | **1** | - | 2 | 2 | | Tested version | 0.18.0 | Apple-provided | 0.10.3 | 0.3.2 | | License | MIT / Apache-2.0 | MIT | MIT | MIT | @@ -69,8 +68,6 @@ Notes: so you can easily retrieve it if you need it. See [examples/print_pos.rs](examples/print_pos.rs) for details. 3. In the `memchr` crate. -4. Binary size overhead according to [cargo-bloat](https://github.com/RazrFalcon/cargo-bloat). -5. Depends on build flags. There is also `elementtree` and `treexml` crates, but they are abandoned for a long time. @@ -139,9 +136,6 @@ You can try running the benchmarks yourself by running `cargo bench` in the `ben - Since all libraries have a different XML support, benchmarking is a bit pointless. - Tree crates may use different *xml-rs* crate versions. - We bench *libxml2* using the *[rust-libxml]* wrapper crate -- *quick-xml* is faster than *xmlparser* because it's more forgiving for the input, - while *xmlparser* is very strict and does a lot of checks, which are expensive. - So performance difference is mainly due to validation. [xml-rs]: https://crates.io/crates/xml-rs [quick-xml]: https://crates.io/crates/quick-xml diff --git a/test-apps/null-app/Cargo.toml b/test-apps/null-app/Cargo.toml deleted file mode 100644 index 32f34fc..0000000 --- a/test-apps/null-app/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "null-app" -version = "0.1.0" -edition = "2018" - -[workspace] - -[[bin]] -name = "app" -path = "app.rs" diff --git a/test-apps/null-app/app.rs b/test-apps/null-app/app.rs deleted file mode 100644 index e0b5e27..0000000 --- a/test-apps/null-app/app.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello world!"); -} diff --git a/test-apps/roxmltree-app/Cargo.toml b/test-apps/roxmltree-app/Cargo.toml deleted file mode 100644 index 7cfe3c4..0000000 --- a/test-apps/roxmltree-app/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "roxmltree-app" -version = "0.1.0" -edition = "2018" - -[workspace] - -[[bin]] -name = "app" -path = "app.rs" - -[dependencies] -roxmltree = { path = "../../" } diff --git a/test-apps/roxmltree-app/app.rs b/test-apps/roxmltree-app/app.rs deleted file mode 100644 index d98a599..0000000 --- a/test-apps/roxmltree-app/app.rs +++ /dev/null @@ -1,14 +0,0 @@ -fn main() { - let text = std::fs::read_to_string(std::env::args().nth(1).unwrap()).unwrap(); - let doc = roxmltree::Document::parse(&text).unwrap(); - - let mut elements = 0; - let mut attributes = 0; - for node in doc.root().descendants().filter(|n| n.is_element()) { - elements += 1; - attributes += node.attributes().len(); - } - - println!("Elements: {}", elements); - println!("Attributes: {}", attributes); -} diff --git a/test-apps/sxd-app/Cargo.toml b/test-apps/sxd-app/Cargo.toml deleted file mode 100644 index a3c9d41..0000000 --- a/test-apps/sxd-app/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "sxd-app" -version = "0.1.0" -edition = "2018" - -[workspace] - -[[bin]] -name = "app" -path = "app.rs" - -[dependencies] -sxd-document = "0.3.0" diff --git a/test-apps/sxd-app/app.rs b/test-apps/sxd-app/app.rs deleted file mode 100644 index 21ecd64..0000000 --- a/test-apps/sxd-app/app.rs +++ /dev/null @@ -1,31 +0,0 @@ -fn main() { - let text = std::fs::read_to_string(std::env::args().nth(1).unwrap()).unwrap(); - let package = sxd_document::parser::parse(&text).unwrap(); - let doc = package.as_document(); - - let mut elements = 0; - let mut attributes = 0; - for child in doc.root().children() { - if let sxd_document::dom::ChildOfRoot::Element(elem) = child { - elements += 1; - attributes += elem.attributes().len(); - count(&elem, &mut elements, &mut attributes); - } - } - - println!("Elements: {}", elements); - println!("Attributes: {}", attributes); -} - -fn count(parent: &sxd_document::dom::Element, elements: &mut usize, attributes: &mut usize) { - for child in parent.children() { - if let sxd_document::dom::ChildOfElement::Element(elem) = child { - *elements += 1; - *attributes += elem.attributes().len(); - - if !elem.children().is_empty() { - count(&elem, elements, attributes); - } - } - } -} diff --git a/test-apps/xmltree-app/Cargo.toml b/test-apps/xmltree-app/Cargo.toml deleted file mode 100644 index 41c9bb7..0000000 --- a/test-apps/xmltree-app/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "xmltree-app" -version = "0.1.0" -edition = "2018" - -[workspace] - -[[bin]] -name = "app" -path = "app.rs" - -[dependencies] -xmltree = "0.10.0" diff --git a/test-apps/xmltree-app/app.rs b/test-apps/xmltree-app/app.rs deleted file mode 100644 index eaff846..0000000 --- a/test-apps/xmltree-app/app.rs +++ /dev/null @@ -1,24 +0,0 @@ -fn main() { - let data = std::fs::read(std::env::args().nth(1).unwrap()).unwrap(); - let root = xmltree::Element::parse(data.as_slice()).unwrap(); - - let mut elements = 1; - let mut attributes = root.attributes.len(); - count(&root, &mut elements, &mut attributes); - - println!("Elements: {}", elements); - println!("Attributes: {}", attributes); -} - -fn count(parent: &xmltree::Element, elements: &mut usize, attributes: &mut usize) { - for child in &parent.children { - if let xmltree::XMLNode::Element(elem) = child { - *elements += 1; - *attributes += elem.attributes.len(); - - if !elem.children.is_empty() { - count(&elem, elements, attributes); - } - } - } -}