File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,27 @@ fn low_level_comparison(c: &mut Criterion) {
54
54
55
55
group. throughput ( Throughput :: Bytes ( data. len ( ) as u64 ) ) ;
56
56
group. bench_with_input (
57
- BenchmarkId :: new ( "quick_xml" , filename) ,
57
+ BenchmarkId :: new ( "quick_xml:borrowed" , filename) ,
58
+ * data,
59
+ |b, input| {
60
+ b. iter ( || {
61
+ let mut reader = Reader :: from_str ( input) ;
62
+ reader. config_mut ( ) . check_end_names = false ;
63
+ let mut count = criterion:: black_box ( 0 ) ;
64
+ loop {
65
+ match reader. read_event ( ) {
66
+ Ok ( Event :: Start ( _) ) | Ok ( Event :: Empty ( _) ) => count += 1 ,
67
+ Ok ( Event :: Eof ) => break ,
68
+ _ => ( ) ,
69
+ }
70
+ }
71
+ assert_eq ! ( count, total_tags, "Overall tag count in {}" , filename) ;
72
+ } )
73
+ } ,
74
+ ) ;
75
+
76
+ group. bench_with_input (
77
+ BenchmarkId :: new ( "quick_xml:buffered" , filename) ,
58
78
* data,
59
79
|b, input| {
60
80
b. iter ( || {
You can’t perform that action at this time.
0 commit comments