Closed dfabulich closed 3 years ago
It's not just a game details page. The main page is also slow to load (at least for the first time in some period of time, since it caches the results).
I think the thing to do here is to load recommendations with a separate AJAX request when you're logged in. That way, you can see the important parts of the page ASAP. (I think that applies both to the game details page and the home page.)
If server processing is a concern, the recommendations can also be stored somewhere, like the browser's localStorage.
I updated
util.php
to modifymysql_query
to add performance logging:Then I tried loading Counterfeit Monkey http://localhost:8080/viewgame?id=aearuuxv83plclpl logged in and logged out. It was night and day; when logged out, the page started loading basically instantly. When logged in as ifdbadmin, the page took 12+ seconds.
It's not quite that bad on production ifdb, maybe 4 seconds? but it's bad.
The big bad query appears to be this one that suggests other recommended games.
Here's how that query ran on my machine: