andrew-codes / playnite-web

Self-hosted Playnite companion web app; offering remote control, automation, sharing what’s in your library with friends.
GNU Affero General Public License v3.0
26 stars 7 forks source link

Game library performance improvements #475

Closed andrew-codes closed 1 month ago

andrew-codes commented 1 month ago

Currently, the entire game library is loaded when viewing the My Library page. This means the query for all games must complete before any HTML is sent to the browser. The delay is significant, upwards of 2-3 seconds just to get the first HTML payload.

Instead, ship only the first N games of data down to the browser. As the user scrolls, fetch more games as necessary. The library should appear as though all games are already present (not pagination navigation buttons).

Note: getting some games is the same cost as getting all games at the moment. This is because to get any set of games requires retrieving all game releases in order to compute the set of games. This will make the query slow regardless of pagination. In order to remedy this, consider a database collection to store games; computed from the current set of games releases. This will enable querying a small data set and also avoid transformations on the dataset to aggregate into games at time of query.

Also note, that new games come in individually via the game db updater. For this reason, the game collection will need to be updated incrementally as new game release come in; as opposed to a single aggregation once all games are "known."

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 5.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: