stopstalk / stopstalk-deployment

Stop stalking and start StopStalking :wink:
https://www.stopstalk.com
MIT License
311 stars 96 forks source link

Optimize leaderboard page with int rating columns #248

Closed raj454raj closed 6 years ago

raj454raj commented 6 years ago

At present rating and prev_rating columns are in string and hence normal orderby and limit helpers couldn't be used.

raj454raj commented 6 years ago

Deploy plan -

  1. Add the columns in auth_user and custom_friend
  2. Copy columns rating and prev_rating to stopstalk_rating and stopstalk_prev_rating respectively. (Do this just before step 3 and stop the update-leaderboard crons)
  3. Update the code to use new columns (Make sure this doesn't break locally)
  4. Deprecate and manually delete the columns from mysql (as web2py won't do it -.-)
raj454raj commented 6 years ago

Benchmarking the page timing after this issue indicates that most of the time is consumed in creating the html in the controller. Issue #247 will help in reducing the load times. We can try handlebars too for the same, let's see if raw js DOM creation helps