From 9214eefba1a19d90ce3e60ce4704c8e1698b04ba Mon Sep 17 00:00:00 2001 From: agra Date: Tue, 2 Jun 2026 09:48:06 +0300 Subject: [PATCH] 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. --- bench/run.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bench/run.sh b/bench/run.sh index b34c3c4..5c3b77c 100755 --- a/bench/run.sh +++ b/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