@@ -132,19 +132,13 @@ fn bench_counter(view: Option<Box<dyn View>>, temporality: &str) -> (SharedReade
132
132
133
133
fn counters ( c : & mut Criterion ) {
134
134
let ( _, cntr) = bench_counter ( None , "cumulative" ) ;
135
- let ( _, cntr2) = bench_counter ( None , "delta" ) ;
136
- let ( _, cntr3) = bench_counter ( None , "cumulative" ) ;
135
+ let ( _, cntr_max) = bench_counter ( None , "cumulative" ) ;
137
136
138
137
let mut group = c. benchmark_group ( "Counter" ) ;
139
138
group. bench_function ( "AddNoAttrs" , |b| b. iter ( || cntr. add ( 1 , & [ ] ) ) ) ;
140
- group. bench_function ( "AddNoAttrsDelta" , |b| b. iter ( || cntr2. add ( 1 , & [ ] ) ) ) ;
141
-
142
139
group. bench_function ( "AddOneAttr" , |b| {
143
140
b. iter ( || cntr. add ( 1 , & [ KeyValue :: new ( "K" , "V" ) ] ) )
144
141
} ) ;
145
- group. bench_function ( "AddOneAttrDelta" , |b| {
146
- b. iter ( || cntr2. add ( 1 , & [ KeyValue :: new ( "K1" , "V1" ) ] ) )
147
- } ) ;
148
142
group. bench_function ( "AddThreeAttr" , |b| {
149
143
b. iter ( || {
150
144
cntr. add (
@@ -157,18 +151,6 @@ fn counters(c: &mut Criterion) {
157
151
)
158
152
} )
159
153
} ) ;
160
- group. bench_function ( "AddThreeAttrDelta" , |b| {
161
- b. iter ( || {
162
- cntr2. add (
163
- 1 ,
164
- & [
165
- KeyValue :: new ( "K2" , "V2" ) ,
166
- KeyValue :: new ( "K3" , "V3" ) ,
167
- KeyValue :: new ( "K4" , "V4" ) ,
168
- ] ,
169
- )
170
- } )
171
- } ) ;
172
154
group. bench_function ( "AddFiveAttr" , |b| {
173
155
b. iter ( || {
174
156
cntr. add (
@@ -183,20 +165,6 @@ fn counters(c: &mut Criterion) {
183
165
)
184
166
} )
185
167
} ) ;
186
- group. bench_function ( "AddFiveAttrDelta" , |b| {
187
- b. iter ( || {
188
- cntr2. add (
189
- 1 ,
190
- & [
191
- KeyValue :: new ( "K5" , "V5" ) ,
192
- KeyValue :: new ( "K6" , "V6" ) ,
193
- KeyValue :: new ( "K7" , "V7" ) ,
194
- KeyValue :: new ( "K8" , "V8" ) ,
195
- KeyValue :: new ( "K9" , "V9" ) ,
196
- ] ,
197
- )
198
- } )
199
- } ) ;
200
168
group. bench_function ( "AddTenAttr" , |b| {
201
169
b. iter ( || {
202
170
cntr. add (
@@ -216,25 +184,6 @@ fn counters(c: &mut Criterion) {
216
184
)
217
185
} )
218
186
} ) ;
219
- group. bench_function ( "AddTenAttrDelta" , |b| {
220
- b. iter ( || {
221
- cntr2. add (
222
- 1 ,
223
- & [
224
- KeyValue :: new ( "K10" , "V10" ) ,
225
- KeyValue :: new ( "K11" , "V11" ) ,
226
- KeyValue :: new ( "K12" , "V12" ) ,
227
- KeyValue :: new ( "K13" , "V13" ) ,
228
- KeyValue :: new ( "K14" , "V14" ) ,
229
- KeyValue :: new ( "K15" , "V15" ) ,
230
- KeyValue :: new ( "K16" , "V16" ) ,
231
- KeyValue :: new ( "K17" , "V17" ) ,
232
- KeyValue :: new ( "K18" , "V18" ) ,
233
- KeyValue :: new ( "K19" , "V19" ) ,
234
- ] ,
235
- )
236
- } )
237
- } ) ;
238
187
239
188
const MAX_DATA_POINTS : i64 = 2000 ;
240
189
let mut max_attributes: Vec < KeyValue > = Vec :: new ( ) ;
@@ -244,14 +193,16 @@ fn counters(c: &mut Criterion) {
244
193
}
245
194
246
195
group. bench_function ( "AddOneTillMaxAttr" , |b| {
247
- b. iter ( || cntr3 . add ( 1 , & max_attributes) )
196
+ b. iter ( || cntr_max . add ( 1 , & max_attributes) )
248
197
} ) ;
249
198
250
199
for i in MAX_DATA_POINTS ..MAX_DATA_POINTS * 2 {
251
200
max_attributes. push ( KeyValue :: new ( i. to_string ( ) , i) )
252
201
}
253
202
254
- group. bench_function ( "AddMaxAttr" , |b| b. iter ( || cntr3. add ( 1 , & max_attributes) ) ) ;
203
+ group. bench_function ( "AddMaxAttr" , |b| {
204
+ b. iter ( || cntr_max. add ( 1 , & max_attributes) )
205
+ } ) ;
255
206
256
207
group. bench_function ( "AddInvalidAttr" , |b| {
257
208
b. iter ( || cntr. add ( 1 , & [ KeyValue :: new ( "" , "V" ) , KeyValue :: new ( "K" , "V" ) ] ) )
0 commit comments