Skip to content

Commit ad5d9af

Browse files
authored
Convert compress benchmark to a binary (#2399)
1 parent 564b458 commit ad5d9af

32 files changed

+1296
-1448
lines changed

.github/workflows/bench-pr.yml

Lines changed: 3 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -22,81 +22,6 @@ jobs:
2222
with:
2323
labels: benchmark
2424

25-
bench-criterion:
26-
needs: label_trigger
27-
strategy:
28-
matrix:
29-
benchmark:
30-
- id: compress
31-
name: Vortex Compression
32-
runs-on: [ self-hosted, gcp ]
33-
if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'benchmark' && github.event_name == 'pull_request' }}
34-
steps:
35-
- uses: actions/checkout@v4
36-
- uses: ./.github/actions/cleanup
37-
- uses: ./.github/actions/setup-rust
38-
39-
# The compression benchmarks rely on DuckDB being installed to convert CSV to Parquet
40-
- name: Install DuckDB
41-
uses: opt-nc/[email protected]
42-
if: runner.environment != 'self-hosted'
43-
with:
44-
version: v1.0.0
45-
46-
- name: Set tempdir
47-
if: runner.environment == 'self-hosted'
48-
run: |
49-
echo "TMPDIR=/work" >> $GITHUB_ENV
50-
51-
- name: Run benchmark
52-
shell: bash
53-
env:
54-
BENCH_VORTEX_RATIOS: '.*'
55-
RUSTFLAGS: '-C target-cpu=native'
56-
run: |
57-
cargo install cargo-criterion
58-
sudo apt-get update && sudo apt-get install -y jq
59-
60-
cargo criterion \
61-
--bench ${{ matrix.benchmark.id }} \
62-
--features mimalloc \
63-
--message-format=json \
64-
> ${{ matrix.benchmark.id }}-raw.json
65-
66-
cat ${{ matrix.benchmark.id }}-raw.json \
67-
| bash scripts/coerce-criterion-json.sh \
68-
> ${{ matrix.benchmark.id }}.json
69-
70-
- name: Setup AWS CLI
71-
uses: aws-actions/configure-aws-credentials@v4
72-
with:
73-
role-to-assume: arn:aws:iam::375504701696:role/GitHubBenchmarkRole
74-
aws-region: us-east-1
75-
- name: Install uv
76-
uses: astral-sh/setup-uv@v5
77-
- name: Compare results
78-
shell: bash
79-
run: |
80-
set -Eeu -o pipefail -x
81-
82-
base_commit_sha=${{ github.event.pull_request.base.sha }}
83-
84-
aws s3 cp s3://vortex-benchmark-results-database/data.json - \
85-
| grep $base_commit_sha \
86-
> base.json
87-
88-
echo '# Benchmarks: ${{ matrix.benchmark.id }}' > comment.md
89-
echo '<details>' >> comment.md
90-
echo '<summary>Table of Results</summary>' >> comment.md
91-
echo '' >> comment.md
92-
uv run scripts/compare-benchmark-jsons.py base.json ${{ matrix.benchmark.id }}.json \
93-
>> comment.md
94-
echo '</details>' >> comment.md
95-
- name: Comment PR
96-
uses: thollander/actions-comment-pull-request@v3
97-
with:
98-
file-path: comment.md
99-
comment-tag: bench-pr-comment-${{ matrix.benchmark.id }}
10025
bench:
10126
needs: label_trigger
10227
runs-on: [ self-hosted, gcp ]
@@ -105,6 +30,8 @@ jobs:
10530
benchmark:
10631
- id: random_access
10732
name: Random Access
33+
- id: compress
34+
name: Compression
10835
if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'benchmark' && github.event_name == 'pull_request' }}
10936
steps:
11037
- uses: actions/checkout@v4
@@ -125,10 +52,9 @@ jobs:
12552
- name: Run ${{ matrix.benchmark.name }} benchmark
12653
shell: bash
12754
env:
128-
BENCH_VORTEX_RATIOS: '.*'
12955
RUSTFLAGS: '-C target-cpu=native'
13056
run: |
131-
cargo run --bin ${{ matrix.benchmark.id }} --release -- -d gh-json -t 1 | tee ${{ matrix.benchmark.id }}.json
57+
cargo run --bin ${{ matrix.benchmark.id }} --release -- -d gh-json | tee ${{ matrix.benchmark.id }}.json
13258
13359
- name: Setup AWS CLI
13460
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/bench.yml

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,65 +29,15 @@ jobs:
2929
bash scripts/commit-json.sh > new-commit.json
3030
bash scripts/cat-s3.sh vortex-benchmark-results-database commits.json new-commit.json
3131
32-
bench-criterion:
33-
strategy:
34-
matrix:
35-
benchmark:
36-
- id: compress
37-
name: Vortex Compression
38-
runs-on: [ self-hosted, gcp ]
39-
steps:
40-
- uses: actions/checkout@v4
41-
- uses: ./.github/actions/cleanup
42-
- uses: ./.github/actions/setup-rust
43-
44-
# The compression benchmarks rely on DuckDB being installed to convert CSV to Parquet
45-
- name: Install DuckDB
46-
uses: opt-nc/[email protected]
47-
if: runner.environment != 'self-hosted'
48-
with:
49-
version: v1.0.0
50-
51-
- name: Set tempdir
52-
if: runner.environment == 'self-hosted'
53-
run: |
54-
echo "TMPDIR=/work" >> $GITHUB_ENV
55-
56-
- name: Run benchmark
57-
shell: bash
58-
env:
59-
BENCH_VORTEX_RATIOS: '.*'
60-
RUSTFLAGS: '-C target-cpu=native'
61-
run: |
62-
cargo install cargo-criterion
63-
sudo apt-get update && sudo apt-get install -y jq
64-
65-
cargo criterion \
66-
--bench ${{ matrix.benchmark.id }} \
67-
--features mimalloc \
68-
--message-format=json \
69-
> ${{ matrix.benchmark.id }}-raw.json
70-
71-
cat ${{ matrix.benchmark.id }}-raw.json \
72-
| bash scripts/coerce-criterion-json.sh \
73-
> ${{ matrix.benchmark.id }}.json
74-
75-
- name: Setup AWS CLI
76-
uses: aws-actions/configure-aws-credentials@v4
77-
with:
78-
role-to-assume: arn:aws:iam::375504701696:role/GitHubBenchmarkRole
79-
aws-region: us-east-1
80-
- name: Upload Benchmark Results
81-
shell: bash
82-
run: |
83-
bash scripts/cat-s3.sh vortex-benchmark-results-database data.json ${{ matrix.benchmark.id }}.json
8432
bench:
8533
runs-on: [ self-hosted, gcp ]
8634
strategy:
8735
matrix:
8836
benchmark:
8937
- id: random_access
9038
name: Random Access
39+
- id: compress
40+
name: Compression
9141
steps:
9242
- uses: actions/checkout@v4
9343
- uses: ./.github/actions/cleanup
@@ -107,7 +57,6 @@ jobs:
10757
- name: Run ${{ matrix.benchmark.name }} benchmark
10858
shell: bash
10959
env:
110-
BENCH_VORTEX_RATIOS: '.*'
11160
RUSTFLAGS: '-C target-cpu=native'
11261
run: |
11362
cargo run --bin ${{ matrix.benchmark.id }} --release -- -d gh-json | tee ${{ matrix.benchmark.id }}.json

.github/workflows/sql-benchmarks.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
if: matrix.remote_storage == null
4545
shell: bash
4646
env:
47-
BENCH_VORTEX_RATIOS: '.*'
4847
RUSTFLAGS: '-C target-cpu=native'
4948
run: |
5049
cargo run \
@@ -58,7 +57,6 @@ jobs:
5857
if: matrix.remote_storage != null
5958
shell: bash
6059
env:
61-
BENCH_VORTEX_RATIOS: '.*'
6260
RUSTFLAGS: '-C target-cpu=native'
6361
run: |
6462
cargo run \

0 commit comments

Comments
 (0)