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 User: `social_type=APPLE`, `social_id=bench-apple-user`
13
+
- Stub delay:
14
+
-`GET /auth/keys`: 80 ms
15
+
-`POST /auth/token`: 300 ms
16
+
- Warmup: 2 minutes
17
+
- Measurement: 5 minutes
18
+
- Full run count: 10 per scenario
19
+
20
+
The benchmark harness lives in `scripts/benchmarks/apple-login/`.
21
+
22
+
## Acceptance Gate
23
+
24
+
Primary scenario: returning Apple User, warm cache, concurrency 1.
25
+
26
+
- JWKS network calls/request: `before 1.0 -> after 0.0`
27
+
- Apple token exchange calls/request: `before 1.0 -> after 0.0`
28
+
- Error rate: `0%`
29
+
- p95 latency: `after <= before * 0.70`
30
+
31
+
Secondary scenarios: returning Apple User, concurrency 10 and 20.
32
+
33
+
- Error rate: `0%`
34
+
- Apple token exchange calls/request: `after 0.0`
35
+
- p95 latency: `after <= before`
36
+
37
+
## Results
38
+
39
+
Populate this table from `scripts/benchmarks/apple-login/results/*/summary.csv` after running both before and after measurements.
- Real Apple network calls are intentionally excluded from the primary benchmark because provider and network variability would obscure backend request-path changes.
53
+
- The script labels results as `before` or `after` but does not change git refs. Select the checkout explicitly before running.
54
+
- Quick mode is for development feedback. Full mode is the acceptance evidence.
- Query-count correctness is intentionally enforced by automated tests because latency is sensitive to JVM warmup, local machine load, and database state.
66
+
- The protected endpoint includes existing API logging work, so the whole-request SQL budget is higher than the authentication-only `User` lookup count.
67
+
- The script labels results as `before` or `after` but does not change git refs. Select the checkout explicitly before running.
68
+
- Quick mode is for development feedback. Full mode is the acceptance evidence.
0 commit comments