-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·63 lines (53 loc) · 1.71 KB
/
run.sh
File metadata and controls
executable file
·63 lines (53 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
set -euo pipefail
SERVICES=(
rust-axum spring-graal-jpa spring-graal-jdbc spring-jpa
spring-graal-reactive python-fastapi go-fiber dotnet-mvc dotnet-aot
)
cd "$(dirname "$0")"
# Parse arguments: optional list of services, or --merge
if [ "${1:-}" = "--merge" ]; then
echo "=== Merge mode: combining results from bench/results/ ==="
(cd bench/client && MERGE=true cargo run --release)
exit 0
fi
if [ $# -eq 0 ]; then
targets=("${SERVICES[@]}")
else
targets=("${@}")
fi
NUM_TASKS="${NUM_TASKS:-5000}"
MAX_CONCURRENCY="${MAX_CONCURRENCY:-100}"
echo "=== Benchmark: ${#targets[@]} target(s), ${NUM_TASKS} tasks, max ${MAX_CONCURRENCY} concurrent ==="
echo " Targets: ${targets[*]}"
# Ensure DB is running
echo ""
echo "[infra] Ensuring database is up..."
docker compose up -d postgres
docker compose up migrations 2>/dev/null || true
# Run each target individually for isolation
for target in "${targets[@]}"; do
echo ""
echo "================================================================"
echo " Benchmarking: ${target}"
echo "================================================================"
(
cd bench/client
TARGETS="$target" \
NUM_TASKS="$NUM_TASKS" \
MAX_CONCURRENCY="$MAX_CONCURRENCY" \
cargo run --release
)
done
# Merge all results into combined report
if [ ${#targets[@]} -gt 1 ]; then
echo ""
echo "================================================================"
echo " Merging results"
echo "================================================================"
(cd bench/client && MERGE=true cargo run --release)
fi
echo ""
echo "=== Done ==="
echo " Per-target results: bench/results/"
echo " Combined report: bench/report.json + bench/report.html"