Skip to content

Reduce JWT auth user lookup count#326

Merged
jjoonleo merged 5 commits into
devfrom
feature/jwt-auth-query-count-325
Jun 30, 2026
Merged

Reduce JWT auth user lookup count#326
jjoonleo merged 5 commits into
devfrom
feature/jwt-auth-query-count-325

Conversation

@jjoonleo

Copy link
Copy Markdown
Contributor

Summary

  • Remove the duplicate User lookup in the JWT protected-request authentication path by moving Active Session validation into AuthTokenService.validateActiveAccessToken(...).
  • Reuse the validated User when saving Spring Security authentication.
  • Add regression coverage for one authentication lookup and a protected-request SQL budget.
  • Add a JWT auth benchmark harness and record quick before/after evidence in docs/performance/jwt-auth-325.md.

Benchmark Evidence

Quick benchmark mode, one 5-minute run per scenario, endpoint GET /users/me/punctuality-score:

scenario before p95 after p95 SQL sample
c1 46.770ms 38.093ms 7 -> 5
c10 52.873ms 40.129ms 7 -> 5
c20 36.560ms 29.620ms 7 -> 5

Validation

  • ./gradlew check
  • scripts/benchmarks/jwt-auth/run.sh before quick against pre-fix worktree
  • scripts/benchmarks/jwt-auth/run.sh after quick against this branch

Closes #325

@jjoonleo jjoonleo marked this pull request as ready for review June 30, 2026 10:44
@jjoonleo jjoonleo merged commit 9792528 into dev Jun 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant