Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest of TPCH #459

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 139 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ getrandom = "0.2.14"
half = { version = "^2", features = ["std", "num-traits"] }
hashbrown = "0.14.3"
humansize = "2.1.3"
indicatif = "0.17.8"
itertools = "0.13.0"
lazy_static = "1.4.0"
leb128 = "0.2.5"
Expand All @@ -85,12 +86,14 @@ num_enum = "0.7.2"
parquet = "52.0.0"
paste = "1.0.14"
pin-project = "1.1.5"
prettytable-rs = "0.10.0"
prost = "0.13.0"
prost-build = "0.13.0"
prost-types = "0.13.0"
pyo3 = { version = "0.21.2", features = ["extension-module", "abi3-py311"] }
pyo3-log = "0.11.0"
rand = "0.8.5"
rayon = "1.10.0"
reqwest = { version = "0.12.0", features = ["blocking"] }
seq-macro = "0.3.5"
serde = "1.0.197"
Expand Down
3 changes: 3 additions & 0 deletions bench-vortex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ enum-iterator = { workspace = true }
flexbuffers = { workspace = true }
futures = { workspace = true, features = ["executor"] }
humansize = { workspace = true }
indicatif = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
mimalloc = { workspace = true }
object_store = { workspace = true, features = ["aws"] }
parquet = { workspace = true, features = [] }
prettytable-rs = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
simplelog = { workspace = true }
Expand Down
83 changes: 56 additions & 27 deletions bench-vortex/benches/tpch_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use bench_vortex::tpch::dbgen::{DBGen, DBGenOptions};
use bench_vortex::tpch::query::Q1;
use bench_vortex::tpch::{load_datasets, Format};
use criterion::{criterion_group, criterion_main, Criterion};
use tokio::runtime::Builder;
Expand All @@ -10,50 +9,80 @@ fn benchmark(c: &mut Criterion) {
// Run TPC-H data gen.
let data_dir = DBGen::new(DBGenOptions::default()).generate().unwrap();

let mut group = c.benchmark_group("tpch q1");
group.sample_size(10);

let ctx = runtime
let vortex_no_pushdown_ctx = runtime
.block_on(load_datasets(
&data_dir,
Format::Vortex {
disable_pushdown: false,
},
))
.unwrap();
group.bench_function("vortex-pushdown", |b| {
b.to_async(&runtime)
.iter(|| async { ctx.sql(Q1).await.unwrap().collect().await.unwrap() })
});

let ctx = runtime
let vortex_ctx = runtime
.block_on(load_datasets(
&data_dir,
Format::Vortex {
disable_pushdown: true,
},
))
.unwrap();
group.bench_function("vortex-nopushdown", |b| {
b.to_async(&runtime)
.iter(|| async { ctx.sql(Q1).await.unwrap().collect().await.unwrap() })
});

let ctx = runtime
let csv_ctx = runtime
.block_on(load_datasets(&data_dir, Format::Csv))
.unwrap();
group.bench_function("csv", |b| {
b.to_async(&runtime)
.iter(|| async { ctx.sql(Q1).await.unwrap().collect().await.unwrap() })
});

let ctx = runtime
let arrow_ctx = runtime
.block_on(load_datasets(&data_dir, Format::Arrow))
.unwrap();
group.bench_function("arrow", |b| {
b.to_async(&runtime)
.iter(|| async { ctx.sql(Q1).await.unwrap().collect().await.unwrap() })
});

for q in 1..=22 {
if q == 15 {
// DataFusion does not support query 15 since it has multiple SQL statements.
}

let query = bench_vortex::tpch::tpch_query(q);

let mut group = c.benchmark_group(format!("tpch_q{q}"));
group.sample_size(10);

group.bench_function("vortex-pushdown", |b| {
b.to_async(&runtime).iter(|| async {
vortex_ctx
.sql(&query)
.await
.unwrap()
.collect()
.await
.unwrap()
})
});

group.bench_function("vortex-nopushdown", |b| {
b.to_async(&runtime).iter(|| async {
vortex_no_pushdown_ctx
.sql(&query)
.await
.unwrap()
.collect()
.await
.unwrap()
})
});

group.bench_function("csv", |b| {
b.to_async(&runtime)
.iter(|| async { csv_ctx.sql(&query).await.unwrap().collect().await.unwrap() })
});

group.bench_function("arrow", |b| {
b.to_async(&runtime).iter(|| async {
arrow_ctx
.sql(&query)
.await
.unwrap()
.collect()
.await
.unwrap()
})
});
}
}

criterion_group!(benches, benchmark);
Expand Down
Loading
Loading