From 75017de2e67ff87baa03589710199c2c86ad7e80 Mon Sep 17 00:00:00 2001 From: James Sharkey Date: Mon, 23 Sep 2024 16:35:06 +0100 Subject: [PATCH] Avoid double-loading full gameboard each request 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. --- src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java b/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java index 96ccf2d94..5a7876b08 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java +++ b/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java @@ -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();