@@ -59,42 +59,6 @@ pub fn queue_benchmark(c: &mut Criterion) {
5959 let rxq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 256 ) ;
6060 let mut queue = rxq. create_queue ( ) ;
6161
62- set_dtable_one_chain ( & rxq, 1 ) ;
63- queue. next_avail = Wrapping ( 0 ) ;
64- let desc = queue. pop ( ) . unwrap ( ) ;
65- c. bench_function ( "next_descriptor_1" , |b| {
66- b. iter ( || {
67- let mut head = Some ( desc) ;
68- while let Some ( d) = head {
69- head = std:: hint:: black_box ( d. next_descriptor ( ) ) ;
70- }
71- } )
72- } ) ;
73-
74- set_dtable_one_chain ( & rxq, 2 ) ;
75- queue. next_avail = Wrapping ( 0 ) ;
76- let desc = queue. pop ( ) . unwrap ( ) ;
77- c. bench_function ( "next_descriptor_2" , |b| {
78- b. iter ( || {
79- let mut head = Some ( desc) ;
80- while let Some ( d) = head {
81- head = std:: hint:: black_box ( d. next_descriptor ( ) ) ;
82- }
83- } )
84- } ) ;
85-
86- set_dtable_one_chain ( & rxq, 4 ) ;
87- queue. next_avail = Wrapping ( 0 ) ;
88- let desc = queue. pop ( ) . unwrap ( ) ;
89- c. bench_function ( "next_descriptor_4" , |b| {
90- b. iter ( || {
91- let mut head = Some ( desc) ;
92- while let Some ( d) = head {
93- head = std:: hint:: black_box ( d. next_descriptor ( ) ) ;
94- }
95- } )
96- } ) ;
97-
9862 set_dtable_one_chain ( & rxq, 16 ) ;
9963 queue. next_avail = Wrapping ( 0 ) ;
10064 let desc = queue. pop ( ) . unwrap ( ) ;
@@ -107,28 +71,6 @@ pub fn queue_benchmark(c: &mut Criterion) {
10771 } )
10872 } ) ;
10973
110- // Queue pop
111-
112- set_dtable_many_chains ( & rxq, 1 ) ;
113- c. bench_function ( "queue_pop_1" , |b| {
114- b. iter ( || {
115- queue. next_avail = Wrapping ( 0 ) ;
116- while let Some ( desc) = queue. pop ( ) {
117- std:: hint:: black_box ( desc) ;
118- }
119- } )
120- } ) ;
121-
122- set_dtable_many_chains ( & rxq, 4 ) ;
123- c. bench_function ( "queue_pop_4" , |b| {
124- b. iter ( || {
125- queue. next_avail = Wrapping ( 0 ) ;
126- while let Some ( desc) = queue. pop ( ) {
127- std:: hint:: black_box ( desc) ;
128- }
129- } )
130- } ) ;
131-
13274 set_dtable_many_chains ( & rxq, 16 ) ;
13375 c. bench_function ( "queue_pop_16" , |b| {
13476 b. iter ( || {
@@ -139,18 +81,6 @@ pub fn queue_benchmark(c: &mut Criterion) {
13981 } )
14082 } ) ;
14183
142- c. bench_function ( "queue_add_used_1" , |b| {
143- b. iter ( || {
144- queue. num_added = Wrapping ( 0 ) ;
145- queue. next_used = Wrapping ( 0 ) ;
146- for i in 0_u16 ..1_u16 {
147- let index = std:: hint:: black_box ( i) ;
148- let len = std:: hint:: black_box ( i + 1 ) ;
149- _ = queue. add_used ( index as u16 , len as u32 ) ;
150- }
151- } )
152- } ) ;
153-
15484 c. bench_function ( "queue_add_used_16" , |b| {
15585 b. iter ( || {
15686 queue. num_added = Wrapping ( 0 ) ;
@@ -178,7 +108,7 @@ pub fn queue_benchmark(c: &mut Criterion) {
178108
179109criterion_group ! {
180110 name = queue_benches;
181- config = Criterion :: default ( ) . sample_size( 200 ) . noise_threshold( 0.05 ) ;
111+ config = Criterion :: default ( ) . sample_size( 1000 ) . noise_threshold( 0.15 ) ;
182112 targets = queue_benchmark
183113}
184114
0 commit comments