You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document records before/after evidence for reducing Apple login latency by removing repeated Apple provider round trips from the returning Apple User login path.
6
+
7
+
Primary benchmark environment:
8
+
9
+
- Backend: local Spring Boot process with `bench` profile
10
+
- Database: isolated Docker MySQL database `ontime_bench`
11
+
- Apple provider: local stub
12
+
- Returning Apple Users: `social_type=APPLE`, `social_id=bench-apple-user-<vu>`
13
+
- Stub delay:
14
+
-`GET /auth/keys`: 80 ms
15
+
-`POST /auth/token`: 300 ms
16
+
- Quick run: default harness settings, 2 minutes warmup and 5 minutes measurement, 1 run per scenario
17
+
- Full evidence run: bounded local run, 30 seconds warmup and 60 seconds measurement, 3 runs per scenario
18
+
- Before checkout: `origin/main` (`ab5fc7f`) plus benchmark harness only (`85b2b18`)
19
+
- After checkout: same benchmark harness plus the #323 fix under test
20
+
21
+
The benchmark harness lives in `scripts/benchmarks/apple-login/`.
22
+
23
+
## Acceptance Gate
24
+
25
+
Primary scenario: returning Apple User, warm cache, concurrency 1.
26
+
27
+
- JWKS network calls/request: `before 1.0 -> after 0.0`
28
+
- Apple token exchange calls/request: `before 1.0 -> after 0.0`
29
+
- Error rate: `0%`
30
+
- p95 latency: `after <= before * 0.70`
31
+
32
+
Secondary scenarios: returning Apple User, concurrency 10 and 20.
33
+
34
+
- Error rate: `0%`
35
+
- Apple token exchange calls/request: `after 0.0`
36
+
- p95 latency: `after <= before`
37
+
38
+
## Results
39
+
40
+
The full rows aggregate 3 runs per scenario by summing requests/provider calls and averaging per-run p50/p95 latency.
- Full before: `scripts/benchmarks/apple-login/results/20260628T051949Z-before-full/summary.csv`
62
+
- Full after: `scripts/benchmarks/apple-login/results/20260628T053451Z-after-full/summary.csv`
63
+
64
+
## Decision
65
+
66
+
The #323 fix passes the acceptance gate in both quick and bounded full runs:
67
+
68
+
- c1 p95 improved from 435.8 ms to 46.5 ms in the full run, an 89.3% reduction.
69
+
- Returning Apple User login used 0.0 JWKS network calls/request after warmup.
70
+
- Returning Apple User login used 0.0 Apple token exchange calls/request after the fix.
71
+
- Error rate stayed at 0% across c1, c10, and c20.
72
+
73
+
## Notes
74
+
75
+
- Real Apple network calls are intentionally excluded from the primary benchmark because provider and network variability would obscure backend request-path changes.
76
+
- The script labels results as `before` or `after` but does not change git refs. Select the checkout explicitly before running.
77
+
- The original single-user concurrency harness caused c10 failures unrelated to #323 because concurrent logins for one **User** raced on single-active-session token rotation. The harness now seeds one returning Apple User per VU so c10/c20 measure Apple provider round trips rather than same-user session contention.
0 commit comments