Open ddugovic opened 1 month ago
What is the issue? The time it takes to retrieve records from the database can vary depending on how much load it is on the server.
The remaining issue is that using this API endpoint one could DDoS Lichess (or write an app which unintentionally generates high server load, with no option to paginate through results to improve response time).
The time to retrieve indexes scales linearly with the number of indexes to load. I used to have about 25 public studies so retrieval consistently took about 3 seconds regardless of server activity; now that I have 1 public study this request (for my username) takes under 1 second, although for users with many public studies this request takes many seconds and retrieves all the public studies of a user.
I have since updated the "profile" command of my Discord bot to no longer list recent public studies of a user, since I was surprised to discover that getting a list of studies (even if I only want a few) can take multiple seconds, for example (getting 400 public study IDs/names):