File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ edition = "2021"
1010[dev-dependencies ]
1111criterion  = { version  = " 0.6" features  = [" html_reports" 
1212markup5ever  = " 0.16" 
13- maybe_xml  = " 0.10.1" 
13+ #  maybe_xml 0.11 regressed perfomance by x2, and because this was the fastest
14+ #  XML parser, we keep benchmarking version 0.10 as well
15+ maybe_xml_0_10  = { version  = " 0.10" package  = " maybe_xml" 
16+ maybe_xml  = " 0.11" 
1417quick-xml  = { path  = " .." features  = [" serialize" 
1518rapid-xml  = " 0.2" 
1619rusty_xml  = { version  = " 0.3" package  = " RustyXML" 
Original file line number Diff line number Diff line change @@ -97,7 +97,29 @@ fn low_level_comparison(c: &mut Criterion) {
9797        ) ; 
9898
9999        group. bench_with_input ( 
100-             BenchmarkId :: new ( "maybe_xml" ,  filename) , 
100+             BenchmarkId :: new ( "maybe_xml:0.10" ,  filename) , 
101+             * data, 
102+             |b,  input| { 
103+                 use  maybe_xml_0_10:: token:: Ty ; 
104+                 use  maybe_xml_0_10:: Reader ; 
105+ 
106+                 b. iter ( || { 
107+                     let  reader = Reader :: from_str ( input) ; 
108+ 
109+                     let  mut  count = black_box ( 0 ) ; 
110+                     for  token in  reader. into_iter ( )  { 
111+                         match  token. ty ( )  { 
112+                             Ty :: StartTag ( _)  | Ty :: EmptyElementTag ( _)  => count += 1 , 
113+                             _ => ( ) , 
114+                         } 
115+                     } 
116+                     assert_eq ! ( count,  total_tags,  "Overall tag count in {}" ,  filename) ; 
117+                 } ) 
118+             } , 
119+         ) ; 
120+ 
121+         group. bench_with_input ( 
122+             BenchmarkId :: new ( "maybe_xml:0.11" ,  filename) , 
101123            * data, 
102124            |b,  input| { 
103125                use  maybe_xml:: token:: Ty ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments