File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ criterion = "0.3"
1111maybe_xml = " 0.2"
1212quick-xml = { path = " .." , features = [" serialize" ] }
1313rapid-xml = " 0.2"
14+ rusty_xml = { version = " 0.3" , package = " RustyXML" }
1415xml_oxide = " 0.3"
1516xml-rs = " 0.8"
1617xml5ever = " 0.17"
Original file line number Diff line number Diff line change @@ -87,6 +87,24 @@ fn low_level_comparison(c: &mut Criterion) {
8787 } )
8888 } ) ;
8989
90+ group. bench_function ( "RustyXML" , |b| {
91+ use rusty_xml:: { Event , Parser } ;
92+
93+ b. iter ( || {
94+ let mut r = Parser :: new ( ) ;
95+ r. feed_str ( SOURCE ) ;
96+
97+ let mut count = criterion:: black_box ( 0 ) ;
98+ for event in r {
99+ match event. unwrap ( ) {
100+ Event :: ElementStart ( _) => count += 1 ,
101+ _ => ( ) ,
102+ }
103+ }
104+ assert_eq ! ( count, 1550 , "Overall tag count in ./tests/sample_rss.xml" ) ;
105+ } )
106+ } ) ;
107+
90108 group. bench_function ( "xml_oxide" , |b| {
91109 use xml_oxide:: sax:: parser:: Parser ;
92110 use xml_oxide:: sax:: Event ;
You can’t perform that action at this time.
0 commit comments