11#! /bin/bash
2+ # ClickBench benchmark for Sirius (GPU-accelerated DuckDB extension)
3+ #
4+ # Usage: ./benchmark.sh
5+ # Prerequisites: NVIDIA GPU with CUDA driver, internet access
26
3- # Install dependencies (ensure the filename matches your setup script)
47source dependencies.sh
58
6- # Ensure Pixi is in the PATH for the current script
7- export PATH=" $HOME /.pixi/bin:$PATH "
9+ # Verify pixi is available
10+ if ! command -v pixi & > /dev/null; then
11+ echo " Error: pixi not found. Check dependencies.sh output."
12+ exit 1
13+ fi
814
9- # Clean up any broken previous runs
15+ # ---------------------------------------------------------------------------
16+ # 1. Build Sirius
17+ # ---------------------------------------------------------------------------
1018rm -rf sirius
11-
12- # Build Sirius from your optimized fork
13- git clone --recurse-submodules -b clickbench https://github.com/sirius-db/sirius.git
19+ git clone --recurse-submodules https://github.com/sirius-db/sirius.git
1420cd sirius
1521
16- # Enable strict error checking: fail immediately if the build crashes
1722set -e
1823
19- # Set up the substrait extension as an external extension (required by sirius)
20- mkdir -p duckdb/extension_external
21- git clone https://github.com/duckdb/substrait.git duckdb/extension_external/substrait
22- git -C duckdb/extension_external/substrait reset --hard ec9f8725df7aa22bae7217ece2f221ac37563da4
23-
24- # Install the pixi environment first so the prefix path exists
2524pixi install
26-
27- # LIBCUDF_ENV_PREFIX must be set before cmake runs (CMakeLists.txt checks it at configure time)
2825export LIBCUDF_ENV_PREFIX=" $( pwd) /.pixi/envs/default"
26+ pixi run make -j" $( nproc) "
2927
30- # Execute the build process inside the isolated Pixi environment
31- pixi run make -j$( nproc)
32-
33- # Inject the Pixi environment variables into the current bash session
28+ # Make the build artifacts available
3429eval " $( pixi shell-hook) "
35-
36- # Add the compiled duckdb binary to the PATH
37- export PATH=" $( pwd) /build/release/:$PATH "
38-
39- # Return to the parent directory
30+ export PATH=" $( pwd) /build/release:$PATH "
4031cd ..
4132
42- # Turn strict error checking back off for the benchmark phase
4333set +e
4434
45- # Load the data
35+ # ---------------------------------------------------------------------------
36+ # 2. Load data
37+ # ---------------------------------------------------------------------------
4638wget --continue --progress=dot:giga ' https://datasets.clickhouse.com/hits_compatible/hits.parquet'
4739
4840echo -n " Load time: "
4941command time -f ' %e' duckdb hits.db -f create.sql -f load.sql
5042
51- # Run the queries
43+ # ---------------------------------------------------------------------------
44+ # 3. Run benchmark
45+ # ---------------------------------------------------------------------------
5246./run.sh 2>&1 | tee log.txt
5347
5448echo -n " Data size: "
5549wc -c hits.db
5650
51+ # ---------------------------------------------------------------------------
52+ # 4. Format results
53+ # ---------------------------------------------------------------------------
5754cat log.txt | \
5855 grep -P ' ^\d|Killed|Segmentation|^Run Time \(s\): real' | \
59- sed -r -e ' s/^.* (Killed|Segmentation).* $/null\nnull\nnull/; s/^Run Time \(s\): real\s*([0-9.]+).*$/\1/' | \
56+ sed -r -e ' s/^.(Killed|Segmentation).$/null\nnull\nnull/; s/^Run Time \(s\): real\s*([0-9.]+).*$/\1/' | \
6057 awk ' {
6158 buf[i++] = $1
6259 if (i == 4) {
6360 printf "[%s,%s,%s],\n", buf[1], buf[2], buf[3]
6461 i = 0
6562 }
66- }'
63+ }'
0 commit comments