Skip to content

Commit

Permalink
Use github benchmark action to run benchmarks (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Aug 12, 2024
1 parent b07a9d9 commit ff952d1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Benchmarks

on:
push:
branches: [develop]
branches: [ develop ]

permissions:
actions: read
Expand All @@ -20,30 +20,29 @@ jobs:
- uses: ./.github/actions/setup-rust
- uses: ./.github/actions/setup-python


- name: Setup bencher.dev CLI
uses: bencherdev/bencher@main

# The compression benchmarks rely on DuckDB being installed to convert CSV to Parquet
- name: Install DuckDB
uses: opt-nc/[email protected]
with:
version: v1.0.0

- name: Upload Vortex Benchmarks
run: |
bencher run \
--project vortex \
--token "${BENCHER_TOKEN}" \
--adapter rust_criterion \
--testbed "github-actions" \
"cargo bench -p bench-vortex"
- name: Run benchmark
run: cargo bench --bench tpch_benchmark -- --output-format bencher | tee output.txt

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Vortex benchmarks
tool: 'cargo'
gh-pages-branch: gh-pages-bench
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file-path: output.txt
summary-always: true
auto-push: true
fail-on-alert: false
env:
BENCHER_TOKEN: ${{ secrets.BENCHER_TOKEN }}
# AWS Credentials for R2 storage tests
AWS_BUCKET: vortex-test
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}


20 changes: 20 additions & 0 deletions bench-vortex/benches/tpch_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ fn benchmark(c: &mut Criterion) {
},
))
.unwrap();
let persistent_uncompressed_vortex_ctx = runtime
.block_on(load_datasets(
&data_dir,
Format::OnDiskVortex {
enable_compression: false,
},
))
.unwrap();

for (q, query) in tpch_queries() {
let mut group = c.benchmark_group(format!("tpch_q{q}"));
Expand Down Expand Up @@ -105,6 +113,18 @@ fn benchmark(c: &mut Criterion) {
.unwrap()
})
});

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

Expand Down

0 comments on commit ff952d1

Please sign in to comment.