Skip to content

Commit 9aeae8c

Browse files
committed
add benchmark
1 parent 27c3abe commit 9aeae8c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: datafusion/functions/benches/repeat.rs

+23
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,29 @@ fn criterion_benchmark(c: &mut Criterion) {
159159
);
160160

161161
group.finish();
162+
163+
// REPEAT overflow
164+
let repeat_times = 1073741824;
165+
let mut group = c.benchmark_group(format!("repeat {} times", repeat_times));
166+
group.sampling_mode(SamplingMode::Flat);
167+
group.sample_size(10);
168+
group.measurement_time(Duration::from_secs(10));
169+
170+
let args = create_args::<i32>(size, 2, repeat_times, false);
171+
group.bench_function(
172+
format!(
173+
"repeat_string overflow [size={}, repeat_times={}]",
174+
size, repeat_times
175+
),
176+
|b| {
177+
b.iter(|| {
178+
// TODO use invoke_with_args
179+
black_box(repeat.invoke_batch(&args, size))
180+
})
181+
},
182+
);
183+
184+
group.finish();
162185
}
163186
}
164187

0 commit comments

Comments
 (0)