Skip to content

Commit 705152e

Browse files
committed
Run core benchmarks with CodSpeed
1 parent c3f0807 commit 705152e

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/codspeed.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: CodSpeed
19+
20+
concurrency:
21+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
22+
cancel-in-progress: true
23+
24+
on:
25+
push:
26+
branches-ignore:
27+
- 'gh-readonly-queue/**'
28+
paths-ignore:
29+
- "docs/**"
30+
- "**.md"
31+
- ".github/ISSUE_TEMPLATE/**"
32+
- ".github/pull_request_template.md"
33+
pull_request:
34+
paths-ignore:
35+
- "docs/**"
36+
- "**.md"
37+
- ".github/ISSUE_TEMPLATE/**"
38+
- ".github/pull_request_template.md"
39+
merge_group:
40+
# manual trigger
41+
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
42+
workflow_dispatch:
43+
44+
jobs:
45+
cargo_bench:
46+
name: cargo bench benchmarks
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Cleanup image # save some space to download benchmark data
50+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache
51+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
52+
- name: Rust Dependency Cache
53+
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
54+
with:
55+
shared-key: "amd-ci-codspeed"
56+
save-if: ${{ github.ref_name == 'main' }}
57+
- name: Setup codspeed
58+
run: cargo install cargo-codspeed
59+
- name: Download benchmark data
60+
run: benchmarks/bench.sh data clickbench_partitioned
61+
- name: Install codpseed-criterion-compat
62+
working-directory: datafusion/core
63+
run: cargo add --dev --rename criterion --features async_tokio,async_futures codspeed-criterion-compat@4.2.0
64+
- name: Build the benchmark targets
65+
working-directory: datafusion/core
66+
run: cargo codspeed build -j 2 --profile release-nonlto --bench sql_planner
67+
- name: Run the benchmarks
68+
uses: CodSpeedHQ/action@972e3437949c89e1357ebd1a2dbc852fcbc57245 # v4.5.1
69+
with:
70+
mode: simulation
71+
working-directory: datafusion/core
72+
run: cargo codspeed run

datafusion/core/benches/sql_planner.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ fn register_defs(ctx: SessionContext, defs: Vec<TableDef>) -> SessionContext {
121121

122122
fn register_clickbench_hits_table(rt: &Runtime) -> SessionContext {
123123
let ctx = SessionContext::new();
124+
rt.block_on(ctx.sql("SET datafusion.execution.parquet.binary_as_string = true"))
125+
.unwrap(); // Needed to make all queries work
124126

125127
// use an external table for clickbench benchmarks
126128
let path =

0 commit comments

Comments
 (0)