climu / openstudyroom

Website for the Open Study Room online go/baduk/weiqi community.
https://openstudyroom.org
GNU General Public License v3.0
67 stars 33 forks source link

improve /league/games/ performance #409

Closed lime-green closed 4 years ago

lime-green commented 4 years ago

Hi this PR improves the performance and usability of /league/games/!

Overall impact is about 50% reduction in time for initial page load, but more significant reduction for time until interactive

lime-green commented 4 years ago

nvm, someone else is working on pagination!

climu commented 4 years ago

Thanks for your work! I will reuse it to paginate with a json API.

I have one question: I think I would have put _build_user_context(user, winner, meijin) in models as a user method. Same with _fetch_and_get_sgfs_context(base_sgfs_queryset) as a sgf method.

Is it best practice to have t hose in views?