Skip to content

Improve/batch answer submission #63

Merged
merged 4 commits into from
Apr 21, 2026
Merged

Conversation

kristwel
Copy link
Collaborator

What does this PR do?

Related issue

Layer(s) affected

  • UI (screens / components)
  • Game Logic (session / round / scoring / state)
  • Domain (model)
  • Infrastructure (Firebase / audio / adapters)

Checklist

  • Code compiles without errors
  • Tested on emulator or device
  • No unrelated changes included
  • Updated README if needed

kristwel and others added 4 commits April 21, 2026 14:14
Replace two parallel Firestore writes (updatePlayerScore + submitAnswer)
with a single WriteBatch.commit() via submitAnswerAndScore(). Reduces
network round-trips on answer submission from two to one.

Also adds temporary P1 latency instrumentation (adb logcat -s P1_LATENCY)
to measure the improvement on-device. Remove the P1 comment blocks in
RoundController once measurements are complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Logs elapsed time from joinSession() call to lobby view display.
Run: adb logcat -s P2_LATENCY
Remove the two P2 comment blocks in LobbyController once done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fire a no-op gamePinExists query when the user navigates to the join
screen. This establishes the gRPC connection before they type a pin,
eliminating the ~1400ms cold-start penalty on the first real Firestore
call during session join.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fires the no-op warmup query at app start rather than when the user
taps Join Game, giving the connection more time to establish before
the first real Firestore call. Reduces cold-start join latency further.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mostafas mostafas merged commit 303f251 into main Apr 21, 2026
1 check failed
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants