MCPcopy Create free account
hub / github.com/apache/datafusion / criterion_benchmark

Function criterion_benchmark

datafusion/core/benches/sql_planner.rs:271–649  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

269}
270
271fn criterion_benchmark(c: &mut Criterion) {
272 // verify that we can load the clickbench data prior to running the benchmark
273 if !PathBuf::from(format!("{BENCHMARKS_PATH_1}{CLICKBENCH_DATA_PATH}")).exists()
274 && !PathBuf::from(format!("{BENCHMARKS_PATH_2}{CLICKBENCH_DATA_PATH}")).exists()
275 {
276 panic!(
277 "benchmarks/data/hits_partitioned/ could not be loaded. Please run \
278 'benchmarks/bench.sh data clickbench_partitioned' prior to running this benchmark"
279 )
280 }
281
282 let ctx = create_context();
283 let rt = Runtime::new().unwrap();
284
285 // Test simplest
286 // https://github.com/apache/datafusion/issues/5157
287 c.bench_function("logical_select_one_from_700", |b| {
288 b.iter(|| logical_plan(&ctx, &rt, "SELECT c1 FROM t700"))
289 });
290
291 // Test simplest
292 // https://github.com/apache/datafusion/issues/5157
293 c.bench_function("physical_select_one_from_700", |b| {
294 b.iter(|| physical_plan(&ctx, &rt, "SELECT c1 FROM t700"))
295 });
296
297 // Test simplest
298 c.bench_function("logical_select_all_from_1000", |b| {
299 b.iter(|| logical_plan(&ctx, &rt, "SELECT * FROM t1000"))
300 });
301
302 // Test simplest
303 c.bench_function("physical_select_all_from_1000", |b| {
304 b.iter(|| physical_plan(&ctx, &rt, "SELECT * FROM t1000"))
305 });
306
307 c.bench_function("logical_trivial_join_low_numbered_columns", |b| {
308 b.iter(|| {
309 logical_plan(
310 &ctx,
311 &rt,
312 "SELECT t1.a2, t2.b2 \
313 FROM t1, t2 WHERE a1 = b1",
314 )
315 })
316 });
317
318 c.bench_function("logical_trivial_join_high_numbered_columns", |b| {
319 b.iter(|| {
320 logical_plan(
321 &ctx,
322 &rt,
323 "SELECT t1.a99, t2.b99 \
324 FROM t1, t2 WHERE a199 = b199",
325 )
326 })
327 });
328

Callers

nothing calls this directly

Calls 15

newFunction · 0.85
union_orderby_queryFunction · 0.85
register_defsFunction · 0.85
tpch_schemasFunction · 0.85
tpcds_schemasFunction · 0.85
existsMethod · 0.80
trimMethod · 0.80
create_contextFunction · 0.70
logical_planFunction · 0.70
physical_planFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…