Closed winprn closed 1 year ago
@leduythuccs Please take a look!
Unfortunately, servicing time for each request does increase. I did some basic optimizations to reduce the increase to ~0.1s.
This is probably the best we can get without pagination.
Description
Type of change: improvement
What
Move the calculation of first solves/total AC from client to server
Why
In
ranking.html
,firstSolve
andtotalAC
loop through all elements in the ranking table and block the browser every time the ranking is refreshed, resulting in bad UX for contests with 1000+ users.Now the calculation is moved to the server. The client no longer needs to process anything and renders much faster. In addition, the ranking table can be cached for all users, so the processing cost is paid only once.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.