Skip to content

Commit 771f4ae

Browse files
committed
Update results and scripts for GlareDB
1 parent b89f139 commit 771f4ae

File tree

7 files changed

+198
-158
lines changed

7 files changed

+198
-158
lines changed

glaredb/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The binary
2+
/glaredb
3+
4+
# Any of the hits files
5+
/data
6+
7+
# Result data, should be manually copied to the right spot if being kept.
8+
results.csv
9+
results.json

glaredb/benchmark.sh

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

3-
# Install
3+
set -e
44

5-
sudo apt-get install -y unzip
6-
curl https://glaredb.com/install.sh | sh
5+
repo_root=$(git rev-parse --show-toplevel)
6+
script_dir=$(dirname "$0")
77

8-
wget https://clickhouse-public-datasets.s3.eu-central-1.amazonaws.com/hits_compatible/athena/hits.parquet
8+
if [[ "$(basename "$repo_root")" == "glaredb" ]]; then
9+
# Inside glaredb repo, build from source.
10+
cargo build --release --bin glaredb
11+
cp "${repo_root}/target/release/glaredb" "${script_dir}/glaredb"
12+
else
13+
# Not in glaredb repo, use prebuilt binary.
14+
export GLAREDB_INSTALL_DIR="${script_dir}"
15+
export GLAREDB_VERSION="v25.5.2"
16+
curl -fsSL https://glaredb.com/install.sh | sh
17+
fi
918

10-
cat queries.sql | while read -r query
11-
do
12-
sync
13-
echo 3 | sudo tee /proc/sys/vm/drop_caches
19+
# Get the data.
20+
mkdir -p "${script_dir}/data"
21+
pushd "${script_dir}/data"
1422

15-
for i in $(seq 1 3); do
16-
./glaredb --timing --query "${query}"
17-
done;
18-
done 2>&1 | tee log.txt
23+
mode="${1:-single}" # Default to 'single' if no arg given.
24+
case "${mode}" in
25+
single)
26+
wget --continue https://clickhouse-public-datasets.s3.eu-central-1.amazonaws.com/hits_compatible/athena/hits.parquet
27+
;;
28+
partitioned)
29+
seq 0 99 | xargs -P100 -I{} bash -c 'wget --continue https://datasets.clickhouse.com/hits_compatible/athena_partitioned/hits_{}.parquet'
30+
;;
31+
*)
32+
echo "Invalid argument to 'benchmark.sh', expected 'single' or 'partitioned'"
33+
exit 1
34+
;;
35+
esac
36+
popd
1937

20-
cat log.txt | grep -oP 'Time: \d+\.\d+s|Error' | sed -r -e 's/Time: ([0-9]+\.[0-9]+)s/\1/; s/Error/null/' | awk '{ if (i % 3 == 0) { printf "[" }; printf $1; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }'
38+
# Ensure working directory is the script dir. The view that gets created uses a
39+
# relative path.
40+
pushd "${script_dir}"
41+
42+
./run.sh "${mode}"

glaredb/create_single.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE TEMP VIEW hits AS
2+
SELECT * REPLACE (EventDate::DATE AS EventDate)
3+
FROM read_parquet('./data/hits.parquet');

glaredb/queries.sql

Lines changed: 43 additions & 43 deletions
Large diffs are not rendered by default.

glaredb/results/c6a.4xlarge.json

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
{
2-
"system": "GlareDB",
3-
"date": "2024-02-02",
2+
"system": "GlareDB (Parquet, single)",
3+
"date": "2025-05-06",
44
"machine": "c6a.4xlarge, 500gb gp2",
55
"cluster_size": 1,
66
"comment": "",
77
"tags": ["Rust", "serverless"],
88
"load_time": 0,
99
"data_size": 14779976446,
1010
"result": [
11-
[0.221,0.070,0.069],
12-
[0.509,0.425,0.424],
13-
[0.569,0.462,0.466],
14-
[0.787,0.483,0.470],
15-
[1.339,1.220,1.200],
16-
[1.800,1.644,1.649],
17-
[0.490,0.418,0.410],
18-
[0.509,0.423,0.423],
19-
[2.009,1.880,1.920],
20-
[3.383,3.134,3.147],
21-
[0.950,0.695,0.702],
22-
[0.891,0.743,0.721],
23-
[1.787,1.646,1.654],
24-
[4.032,3.007,2.974],
25-
[1.911,1.746,1.762],
26-
[1.538,1.321,1.360],
27-
[3.746,3.335,3.327],
28-
[3.611,3.064,2.993],
29-
[7.835,6.293,6.414],
30-
[0.882,0.469,0.470],
31-
[9.903,1.943,1.947],
32-
[11.653,2.182,2.172],
33-
[22.503,4.410,4.416],
34-
[56.481,11.754,11.769],
35-
[3.039,0.925,0.917],
36-
[1.132,0.854,0.855],
37-
[2.939,0.991,0.973],
38-
[9.958,2.688,2.695],
39-
[9.431,5.639,5.614],
40-
[1.027,0.872,0.814],
41-
[2.611,1.508,1.497],
42-
[6.177,1.887,1.960],
43-
[9.675,9.095,8.891],
44-
[12.268,7.139,7.063],
45-
[12.675,7.661,7.671],
46-
[2.418,2.250,2.210],
47-
[9.998,2.095,2.066],
48-
[9.273,2.782,2.722],
49-
[10.015,2.085,2.079],
50-
[18.876,3.284,3.317],
51-
[2.963,0.939,0.917],
52-
[2.165,0.973,0.936],
53-
[1.380,0.901,0.864]
54-
]
11+
[0.039,0.039,0.039],
12+
[0.137,0.132,0.127],
13+
[0.221,0.206,0.203],
14+
[0.302,0.153,0.153],
15+
[1.034,1.036,1.026],
16+
[1.187,1.175,1.153],
17+
[0.105,0.104,0.104],
18+
[0.143,0.146,0.149],
19+
[1.594,1.584,1.597],
20+
[1.884,1.887,1.875],
21+
[0.532,0.516,0.527],
22+
[0.599,0.604,0.603],
23+
[1.105,1.110,1.088],
24+
[2.374,2.327,2.346],
25+
[1.203,1.220,1.198],
26+
[1.336,1.341,1.343],
27+
[2.463,2.459,2.484],
28+
[2.168,2.161,2.132],
29+
[4.608,4.527,4.519],
30+
[0.196,0.187,0.189],
31+
[9.395,1.675,1.709],
32+
[1.687,1.713,1.724],
33+
[8.470,3.776,3.625],
34+
[31.127,13.872,13.891],
35+
[0.884,0.894,0.895],
36+
[0.969,0.964,0.970],
37+
[1.086,1.086,1.090],
38+
[1.593,1.570,1.617],
39+
[12.072,12.256,11.149],
40+
[4.814,4.740,4.749],
41+
[1.243,1.250,1.239],
42+
[1.529,1.540,1.553],
43+
[6.825,6.214,6.111],
44+
[4.154,4.139,4.186],
45+
[4.319,4.420,4.407],
46+
[1.474,1.454,1.467],
47+
[0.196,0.212,0.203],
48+
[0.184,0.168,0.167],
49+
[0.132,0.130,0.131],
50+
[0.369,0.371,0.373],
51+
[0.078,0.078,0.077],
52+
[0.079,0.079,0.074],
53+
[0.087,0.087,0.085]
54+
]
5555
}

glaredb/results/c6a.metal.json

Lines changed: 0 additions & 55 deletions
This file was deleted.

glaredb/run.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
set -o pipefail
5+
6+
case "$1" in
7+
single)
8+
create_sql_file="create_single.sql"
9+
;;
10+
*)
11+
echo "Invalid argument to 'run.sh', expected 'single'"
12+
exit 1
13+
;;
14+
esac
15+
16+
TRIES=3
17+
QUERY_NUM=0
18+
19+
echo "[" > results.json
20+
echo "query_num,iteration,duration" > results.csv
21+
22+
cat queries.sql | while read -r query; do
23+
sync
24+
if [[ -r /proc/sys/vm/drop_caches ]]; then
25+
# Only try to run this if we have a proc file system.
26+
# Aka not mac.
27+
echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null
28+
fi
29+
30+
echo "${QUERY_NUM}: ${query}"
31+
32+
[ "${QUERY_NUM}" != 0 ] && echo "," >> results.json
33+
echo -n " [" >> results.json
34+
35+
for i in $(seq 1 $TRIES); do
36+
output=$(./glaredb --init "${create_sql_file}" -c ".timer on" -c "${query}")
37+
duration=$(awk -F': ' '/^Execution duration/ { printf "%.3f\n", $2 }' <<< "$output")
38+
39+
echo "$output"
40+
41+
if [ -z "${duration}" ]; then
42+
echo "Query failed"
43+
exit 1
44+
fi
45+
46+
# JSON results
47+
echo -n "${duration}" >> results.json
48+
[ "${i}" != "${TRIES}" ] && echo -n "," >> results.json
49+
50+
# CSV results
51+
echo "${QUERY_NUM},${i},${duration}" >> results.csv
52+
done
53+
54+
echo -n "]" >> results.json
55+
56+
QUERY_NUM=$((QUERY_NUM + 1))
57+
done
58+
59+
echo "" >> results.csv
60+
echo "" >> results.json
61+
echo "]" >> results.json

0 commit comments

Comments
 (0)