Skip to content

Commit

Permalink
Add RustyXML to comparison
Browse files Browse the repository at this point in the history
Usages: 63 (16 direct) according to https://lib.rs/crates/RustyXML
  • Loading branch information
Mingun committed May 21, 2022
1 parent dda8879 commit d7781b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions compare/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ criterion = "0.3"
maybe_xml = "0.2"
quick-xml = { path = "..", features = ["serialize"] }
rapid-xml = "0.2"
rusty_xml = { version = "0.3", package = "RustyXML" }
xml_oxide = "0.3"
xml-rs = "0.8"
xml5ever = "0.17"
Expand Down
18 changes: 18 additions & 0 deletions compare/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ fn low_level_comparison(c: &mut Criterion) {
})
});

group.bench_function("RustyXML", |b| {
use rusty_xml::{Event, Parser};

b.iter(|| {
let mut r = Parser::new();
r.feed_str(SOURCE);

let mut count = criterion::black_box(0);
for event in r {
match event.unwrap() {
Event::ElementStart(_) => count += 1,
_ => (),
}
}
assert_eq!(count, 1550, "Overall tag count in ./tests/sample_rss.xml");
})
});

group.bench_function("xml_oxide", |b| {
use xml_oxide::sax::parser::Parser;
use xml_oxide::sax::Event;
Expand Down

0 comments on commit d7781b1

Please sign in to comment.