paper-dynasty-card-creation/scripts/benchmark_results.txt
Cal Corum 979f3080d5 feat: concurrent upload pipeline and benchmarks (Phase 0)
- Replace sequential upload loop with asyncio.gather + Semaphore(8) (WP-04)
- Offload synchronous boto3 S3 calls to thread pool executor
- Increase fetch_card_image timeout from 6s to 10s
- Add --concurrency/-j CLI flag to pd-cards upload
- Add progress reporting every 20 completions
- Individual card failures no longer abort batch
- Apply same concurrency pattern to legacy check_cards_and_upload.py (WP-05)
- Add benchmark script for render pipeline measurements (WP-00)

Target: 800-card upload from ~40 min to <5 min (with server-side
persistent browser deployed).

Refs: #87, #91, #92

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:53:56 -05:00

94 lines
3.5 KiB
Plaintext

Paper Dynasty Card Render Benchmark
Run timestamp : 2026-03-12 23:40:54
API target : https://pddev.manticorum.com/api
Cache-bust tag: benchmark-1773376854
==============================================================
Paper Dynasty Card Render Benchmark - WP-00 / Phase 0
2026-03-12 23:40:54
API: https://pddev.manticorum.com/api
==============================================================
--- Section 1: Connectivity Check ---
Sending single request to verify API is reachable...
Player : 12785 (batting card)
URL : https://pddev.manticorum.com/api/v2/players/12785/battingcard?d=benchmark-1773376854-probe
HTTP : 200 OK
Total : 1.944s
Connect: 0.010s
TTFB : 1.933s
Size : 192175 bytes (187.6KB)
Connectivity: PASS
--- Section 2: Sequential Card Render Benchmark ---
Rendering 10 cards sequentially with fresh cache busts.
Each request forces a full server-side render (bypasses nginx cache).
Player HTTP Total(s) TTFB(s) Connect(s) Size(KB)
--------------------------------------------------------------
12785 200 0.056 0.046 0.008 187.6
12790 200 1.829 1.815 0.008 202.3
12800 200 2.106 2.096 0.008 192.4
12810 200 1.755 1.745 0.009 189.8
12820 200 2.041 2.030 0.009 193.1
12830 200 2.433 2.423 0.009 180.3
12840 200 2.518 2.507 0.009 202.3
12850 200 2.191 2.174 0.009 187.6
12860 200 2.478 2.469 0.009 190.4
12870 200 2.913 2.901 0.009 192.8
--- Section 2: Results Summary ---
Cards requested : 10
Successful : 10
Failed : 0
Total wall time : 20.321s
Average per card : 2.032s
Minimum : 0.056s
Maximum : 2.913s
Sequential throughput: ~29.5 cards/min
Est. full cardset (1000 renders, sequential): ~2032s (~33.8 min)
--- Section 3: Upload Pipeline Benchmark Commands ---
The upload pipeline (pd_cards/core/upload.py) fetches rendered PNG cards
and uploads them to S3. It uses a persistent aiohttp session with a 6s
timeout per card.
To time a dry-run batch of 20 cards:
cd /mnt/NV2/Development/paper-dynasty/card-creation
time pd-cards upload s3 --cardset "2005 Live" --limit 20 --dry-run
To time a real upload batch of 20 cards (writes to S3, updates DB URLs):
time pd-cards upload s3 --cardset "2005 Live" --limit 20
Notes:
- dry-run validates card URLs exist without uploading
- Remove --limit for full cardset run
- Pipeline is currently sequential (one card at a time per session)
- Each card: fetch PNG (~2-4s render) + S3 put (~0.1-0.5s) = ~2.5-4.5s/card
- Parallelism target (Phase 0 goal): 10-20 concurrent fetches via asyncio
--- Section 4: Before/After Comparison Template ---
Fill in after optimization work is complete.
Metric Before After Delta
----------------------------------------------------------------
Avg render time (s) 2.032 ___._____ ___._____
Min render time (s) 0.056 ___._____ ___._____
Max render time (s) 2.913 ___._____ ___._____
Sequential cards/min 29.5 ___.___ ___.___
Upload batch (20 cards) ___._____s ___._____s ___._____s
Upload cards/min ___.___ ___.___ ___.___
Full cardset time (est) ___._____min ___._____min ___ min saved
Benchmark complete.
Results saved to: scripts/benchmark_results.txt