1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

fix measure.sh for macos

This commit is contained in:
renerocksai 2025-03-16 20:34:33 +01:00
parent fcce4517de
commit 24aacac58d
No known key found for this signature in database

View file

@ -5,9 +5,13 @@ DURATION_SECONDS=10
SUBJECT=$1 SUBJECT=$1
if echo $(uname) -eq "Darwin" ; then
TSK_SRV=""
TSK_LOAD=""
else
TSK_SRV="taskset -c 0,1,2,3" TSK_SRV="taskset -c 0,1,2,3"
TSK_LOAD="taskset -c 4,5,6,7" TSK_LOAD="taskset -c 4,5,6,7"
fi
if [ "$SUBJECT" = "" ] ; then if [ "$SUBJECT" = "" ] ; then
echo "usage: $0 subject # subject: zig or go" echo "usage: $0 subject # subject: zig or go"
@ -29,7 +33,7 @@ if [ "$SUBJECT" = "zigstd" ] ; then
fi fi
if [ "$SUBJECT" = "go" ] ; then if [ "$SUBJECT" = "go" ] ; then
cd wrk/go && go build main.go cd wrk/go && go build main.go
$TSK_SRV ./main & $TSK_SRV ./main &
PID=$! PID=$!
URL=http://127.0.0.1:8090/hello URL=http://127.0.0.1:8090/hello
@ -94,7 +98,7 @@ sleep 1
echo "========================================================================" echo "========================================================================"
echo " $SUBJECT" echo " $SUBJECT"
echo "========================================================================" echo "========================================================================"
$TSK_LOAD wrk -c $CONNECTIONS -t $THREADS -d $DURATION_SECONDS --latency $URL $TSK_LOAD wrk -c $CONNECTIONS -t $THREADS -d $DURATION_SECONDS --latency $URL
kill $PID kill $PID