Skip to content

Commit

Permalink
Avoid double-loading full gameboard each request
Browse files Browse the repository at this point in the history
We load the gameboard initially not just to check it exists but also to
load the question IDs; these are used to speed up loading question
attempts a lot.
However, the full gameboard requires going to ElasticSearch and then
mapping a bunch of objects between classes. Since we never use anything
from these objects that is not in a Lite (unaugmented) gameboard this
is entirely wasted work.
The end effect is minor since loading question attempts and the full
gameboard still dominate, but I still think worthwhile.
  • Loading branch information
jsharkey13 committed Sep 23, 2024
1 parent 64685d9 commit 75017de
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public final Response getGameboard(@Context final Request request,

AbstractSegueUserDTO randomUser = this.userManager.getCurrentUser(httpServletRequest);

GameboardDTO unAugmentedGameboard = gameManager.getGameboard(gameboardId);
GameboardDTO unAugmentedGameboard = gameManager.getLiteGameboard(gameboardId);
if (null == unAugmentedGameboard) {
return new SegueErrorResponse(Status.NOT_FOUND, "No Gameboard found for the id specified.")
.toResponse();
Expand Down

0 comments on commit 75017de

Please sign in to comment.