chore(bench): build servers into .sx-tmp; fix stale example path
Some checks failed
Build / build-linux (push) Has been cancelled
Build / build-windows (push) Has been cancelled

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:
agra
2026-06-02 09:48:06 +03:00
parent 2c518f2dc4
commit 9214eefba1

View File

@@ -5,6 +5,9 @@
set -e set -e
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
# Build outputs go in the gitignored scratch dir, not the tree.
mkdir -p .sx-tmp
REQUESTS=${1:-10000} REQUESTS=${1:-10000}
CONCURRENCY=${2:-50} CONCURRENCY=${2:-50}
WARMUP=500 WARMUP=500
@@ -31,11 +34,11 @@ echo ""
# --- Build --- # --- Build ---
echo -e "${BOLD}Building sx server...${RESET}" 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 " $time_sx_build"
echo -e "${BOLD}Building zig server...${RESET}" 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 " $time_zig_build"
echo "" echo ""
@@ -68,7 +71,7 @@ run_bench() {
} }
# --- sx server --- # --- sx server ---
bench/sx-server > /dev/null 2>&1 & .sx-tmp/sx-server > /dev/null 2>&1 &
SX_PID=$! SX_PID=$!
wait_for_port $SX_PORT wait_for_port $SX_PORT
@@ -79,7 +82,7 @@ SX_PID=""
sleep 0.5 sleep 0.5
# --- zig server --- # --- zig server ---
bench/zig-server > /dev/null 2>&1 & .sx-tmp/zig-server > /dev/null 2>&1 &
ZIG_PID=$! ZIG_PID=$!
wait_for_port $ZIG_PORT wait_for_port $ZIG_PORT