chore(bench): build servers into .sx-tmp; fix stale example path
The bench built sx-server/zig-server into bench/ (committed as stray artifacts) and pointed at the pre-migration examples/32-http-server.sx. Now builds into the gitignored .sx-tmp/ and uses the current examples/1602-platform-http-server.sx, so a run leaves the tree clean.
This commit is contained in:
11
bench/run.sh
11
bench/run.sh
@@ -5,6 +5,9 @@
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Build outputs go in the gitignored scratch dir, not the tree.
|
||||
mkdir -p .sx-tmp
|
||||
|
||||
REQUESTS=${1:-10000}
|
||||
CONCURRENCY=${2:-50}
|
||||
WARMUP=500
|
||||
@@ -31,11 +34,11 @@ echo ""
|
||||
|
||||
# --- Build ---
|
||||
echo -e "${BOLD}Building sx server...${RESET}"
|
||||
time_sx_build=$( { time ./zig-out/bin/sx build examples/32-http-server.sx -o bench/sx-server 2>&1; } 2>&1 | tail -1 )
|
||||
time_sx_build=$( { time ./zig-out/bin/sx build examples/1602-platform-http-server.sx -o .sx-tmp/sx-server 2>&1; } 2>&1 | tail -1 )
|
||||
echo " $time_sx_build"
|
||||
|
||||
echo -e "${BOLD}Building zig server...${RESET}"
|
||||
time_zig_build=$( { time zig build-exe bench/http-server.zig -O ReleaseFast -femit-bin=bench/zig-server 2>&1; } 2>&1 | tail -1 )
|
||||
time_zig_build=$( { time zig build-exe bench/http-server.zig -O ReleaseFast -femit-bin=.sx-tmp/zig-server 2>&1; } 2>&1 | tail -1 )
|
||||
echo " $time_zig_build"
|
||||
echo ""
|
||||
|
||||
@@ -68,7 +71,7 @@ run_bench() {
|
||||
}
|
||||
|
||||
# --- sx server ---
|
||||
bench/sx-server > /dev/null 2>&1 &
|
||||
.sx-tmp/sx-server > /dev/null 2>&1 &
|
||||
SX_PID=$!
|
||||
wait_for_port $SX_PORT
|
||||
|
||||
@@ -79,7 +82,7 @@ SX_PID=""
|
||||
sleep 0.5
|
||||
|
||||
# --- zig server ---
|
||||
bench/zig-server > /dev/null 2>&1 &
|
||||
.sx-tmp/zig-server > /dev/null 2>&1 &
|
||||
ZIG_PID=$!
|
||||
wait_for_port $ZIG_PORT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user