Skip to content

Commit 3facb10

Browse files
committed
Remove unnecessary reset_site calls from run.sh benchmark script
1 parent 24ab635 commit 3facb10

File tree

1 file changed

+2
-10
lines changed
  • html-generators/benchmark

1 file changed

+2
-10
lines changed

html-generators/benchmark/run.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ UPDATE_MD=false
2121
# ---------------------------------------------------------------------------
2222
# Helpers
2323
# ---------------------------------------------------------------------------
24-
reset_site() { git checkout -- site/index.html 2>/dev/null || true; }
2524

2625
# Run a command $RUNS times, collect real times into $TIMES array
2726
bench() {
2827
local label="$1"; shift
2928
TIMES=()
3029
for ((i = 1; i <= RUNS; i++)); do
31-
reset_site
3230
local t
3331
t=$( { /usr/bin/time -p "$@" > /dev/null; } 2>&1 | awk '/^real/ {print $2}' )
3432
TIMES+=("$t")
@@ -68,16 +66,15 @@ echo ""
6866
echo "=== Setup: building AOT cache ==="
6967
java -XX:AOTCacheOutput="$AOT" -jar "$JAR" > /dev/null 2>&1
7068
echo "Cache: $AOT ($(du -h "$AOT" | cut -f1 | tr -d ' '))"
71-
reset_site
7269
echo ""
7370

7471
# ---------------------------------------------------------------------------
7572
# Benchmark
7673
# ---------------------------------------------------------------------------
7774
echo "=== Benchmark ($RUNS runs each: 1 cold + $((RUNS - 1)) warm) ==="
7875
echo ""
79-
printf "| %-42s | %7s | %10s |\n" "Method" "Cold" "Warm Avg"
80-
printf "|%-44s|%9s|%12s|\n" "--------------------------------------------" "---------" "------------"
76+
printf "| %-42s | %6s | %10s |\n" "Method" "Cold" "Warm Avg"
77+
printf "|%-44s|%7s|%12s|\n" "--------------------------------------------" "--------" "------------"
8178

8279
AOT_COLD="" ; AOT_WARM=""
8380
JAR_COLD="" ; JAR_WARM=""
@@ -87,7 +84,6 @@ PY_COLD="" ; PY_WARM=""
8784
# Fat JAR + AOT
8885
TIMES=()
8986
for ((i = 1; i <= RUNS; i++)); do
90-
reset_site
9187
t=$( { /usr/bin/time -p java -XX:AOTCache="$AOT" -jar "$JAR" > /dev/null; } 2>&1 | awk '/^real/ {print $2}' )
9288
TIMES+=("$t")
9389
done
@@ -99,7 +95,6 @@ printf "| %-42s | %5ss | **%5ss** |\n" "**Fat JAR + AOT** (\`java -XX:AOTCache\`
9995
# Fat JAR
10096
TIMES=()
10197
for ((i = 1; i <= RUNS; i++)); do
102-
reset_site
10398
t=$( { /usr/bin/time -p java -jar "$JAR" > /dev/null; } 2>&1 | awk '/^real/ {print $2}' )
10499
TIMES+=("$t")
105100
done
@@ -111,7 +106,6 @@ printf "| %-42s | %5ss | **%5ss** |\n" "**Fat JAR** (\`java -jar\`)" "$JAR_COLD"
111106
# JBang
112107
TIMES=()
113108
for ((i = 1; i <= RUNS; i++)); do
114-
reset_site
115109
t=$( { /usr/bin/time -p jbang html-generators/generate.java > /dev/null; } 2>&1 | awk '/^real/ {print $2}' )
116110
TIMES+=("$t")
117111
done
@@ -123,7 +117,6 @@ printf "| %-42s | %5ss | **%5ss** |\n" "**JBang** (\`jbang generate.java\`)" "$J
123117
# Python
124118
TIMES=()
125119
for ((i = 1; i <= RUNS; i++)); do
126-
reset_site
127120
t=$( { /usr/bin/time -p python3 html-generators/generate.py > /dev/null; } 2>&1 | awk '/^real/ {print $2}' )
128121
TIMES+=("$t")
129122
done
@@ -133,7 +126,6 @@ PY_WARM=$(echo "scale=2; $sum / ($RUNS - 1)" | bc | sed 's/^\./0./')
133126
printf "| %-42s | %5ss | **%5ss** |\n" "**Python** (\`python3 generate.py\`)" "$PY_COLD" "$PY_WARM"
134127

135128
echo ""
136-
reset_site
137129

138130
# ---------------------------------------------------------------------------
139131
# Optionally update BENCHMARK.md

0 commit comments

Comments
 (0)