(c: &mut Criterion)
| 208 | } |
| 209 | |
| 210 | fn bench_write_var_i64_medium(c: &mut Criterion) { |
| 211 | let mut group = c.benchmark_group("write_var_i64_medium"); |
| 212 | group.throughput(Throughput::Elements(1000)); |
| 213 | |
| 214 | let values: Vec<i64> = (0..1000).map(|i| i * 1000000).collect(); // Medium values (3-4 bytes) |
| 215 | |
| 216 | group.bench_function("current", |b| { |
| 217 | let mut buf = Vec::with_capacity(5000); |
| 218 | b.iter(|| { |
| 219 | buf.clear(); |
| 220 | let mut writer = Writer::from_buffer(&mut buf); |
| 221 | for &val in &values { |
| 222 | writer.write_var_i64(black_box(val)); |
| 223 | } |
| 224 | black_box(&buf); |
| 225 | }) |
| 226 | }); |
| 227 | |
| 228 | group.finish(); |
| 229 | } |
| 230 | |
| 231 | fn bench_write_var_i64_large(c: &mut Criterion) { |
| 232 | let mut group = c.benchmark_group("write_var_i64_large"); |
nothing calls this directly
no test coverage detected