diff --git a/.gitignore b/.gitignore index 2725e46..fa64fac 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,6 @@ postgres_data/ README_GAUNTLET_CLEANUP.md wipe_gauntlet_team.py SCHEMA.md + +# Benchmark output files +benchmarks/render_timings.txt diff --git a/benchmarks/BASELINE.md b/benchmarks/BASELINE.md index 1f26b7d..2f4bb42 100644 --- a/benchmarks/BASELINE.md +++ b/benchmarks/BASELINE.md @@ -70,8 +70,8 @@ echo "Elapsed: $(( (END - START) / 1000 )).$(( (END - START) % 1000 ))s" | Environment | Cards | Elapsed (s) | Per-card avg (s) | |-------------|-------|-------------|-----------------| -| dev | 20 | _TBD_ | _TBD_ | -| dev | 20 | _TBD_ | _TBD_ | +| dev (batting) | 20 | _TBD_ | _TBD_ | +| dev (pitching) | 20 | _TBD_ | _TBD_ | > **Note:** Run the upload command in the `card-creation` repo and record timings here. diff --git a/benchmarks/benchmark_renders.sh b/benchmarks/benchmark_renders.sh index 4046d5b..a9c5d6e 100755 --- a/benchmarks/benchmark_renders.sh +++ b/benchmarks/benchmark_renders.sh @@ -48,13 +48,9 @@ TOTAL=0 COUNT=0 for player_id in "${PLAYER_IDS[@]}"; do - URL="$API_BASE/api/v2/players/$player_id/${CARD_TYPE}card" - # Bypass cached PNG files by adding ?nocache=1 (treated as unknown param, triggers re-render) - # Remove this flag after baseline is captured to test cache-hit performance separately. - HTTP_CODE=$(curl -s -o /dev/null \ - --write-out "%{http_code}" \ - -w " %{time_total}" \ - "$URL" 2>&1) + # Bypass cached PNG files; remove ?nocache=1 after baseline is captured to test cache-hit performance. + URL="$API_BASE/api/v2/players/$player_id/${CARD_TYPE}card?nocache=1" + HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code} %{time_total}" "$URL" 2>&1) STATUS=$(echo "$HTTP_CODE" | awk '{print $1}') TIMING=$(echo "$HTTP_CODE" | awk '{print $2}') echo " player_id=$player_id http=$STATUS time=${TIMING}s" | tee -a "$OUTFILE"