MCPcopy Create free account
hub / github.com/apache/fory / bench_write_var_i64_medium

Function bench_write_var_i64_medium

benchmarks/rust/benches/buffer_write_bench.rs:210–229  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

208}
209
210fn 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
231fn bench_write_var_i64_large(c: &mut Criterion) {
232 let mut group = c.benchmark_group("write_var_i64_large");

Callers

nothing calls this directly

Calls 4

write_var_i64Method · 0.80
mapMethod · 0.45
clearMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected