Skip to content

Commit

Permalink
chore: pgo/bench script cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
sgammon committed Jun 7, 2024
1 parent 78db8ca commit 3f781c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
4 changes: 2 additions & 2 deletions tools/scripts/bench-cli.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#env bash
#!/bin/env bash

source ./tools/scripts/bench-common.sh

Expand All @@ -8,7 +8,7 @@ ELIDE="$1"
HYPERFINE_ARGS="--shell none"

# run `--help`
hyperfine $HYPERFINE_ARGS "$ELIDE --help"
hyperfine $HYPERFINE_ARGS $ELIDE --help

# run some hello scripts
hyperfine $HYPERFINE_ARGS -n hello-js "$ELIDE run --javascript ./tools/scripts/hello.js" -n hello-ts "$ELIDE run --typescript ./tools/scripts/hello.ts"
Expand Down
24 changes: 5 additions & 19 deletions tools/scripts/bench-server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#env bash
#!/bin/env bash

source ./tools/scripts/bench-common.sh

Expand All @@ -10,29 +10,15 @@ if [ ! -f "$ELIDE" ]; then
exit 2
fi

if [[ -x "$file" ]]; then
# nothing
else
echo "Elide binary is not executable"
exit 2
fi

VERSION=$("$ELIDE --version")

echo "Starting server bench for Elide at version $VERSION"

# run the server
"$ELIDE serve --javascript $SERVER_JS" &
ELIDE_JS_SERVER_PID=$!
$ELIDE --version
echo "Starting server bench for Elide..."

OHA_ARGS="-c 1024 -z 60s --http-version 1.1"
WRK_ARGS="-c 1024 -d 60s -t 12 -L --timeout 10s -R 500000"
OHA_ARGS="-c 2048 -z 60s --http-version 1.1"
WRK_ARGS="-c 2048 -d 60s -t 16 -L --timeout 15s -R 700000"
HYPERFINE_ARGS="--warmup 5000 --runs 1000 --shell none"

hyperfine $HYPERFINE_ARGS "curl http://localhost:3000/plaintext"
oha $OHA_ARGS http://localhost:3000/plaintext
wrk $WRK_ARGS http://localhost:3000/plaintext

echo "Halting JS server at PID $ELIDE_JS_SERVER_PID"
kill -SIGINT "$ELIDE_JS_SERVER_PID"
echo "Server bench done."
2 changes: 1 addition & 1 deletion tools/scripts/train-pgo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#env bash
#!/bin/env bash

# Resolved Elide binary
ELIDE="$1"
Expand Down

0 comments on commit 3f781c9

Please sign in to comment.