sleepers-anonymous / zscore

Sleeping competition app
MIT License
7 stars 6 forks source link

Leaderboard takes 5s to load on zscore.mit.edu #52

Open emannes opened 8 years ago

emannes commented 8 years ago

The offending line is https://github.com/sleepers-anonymous/zscore/blob/master/sleep/views/__init__.py#L253:

 ss = Sleeper.objects.sorted_sleepers(sortBy=sort_by,user=request.user,group=group)
benjaminjkraft commented 8 years ago

Yeah, the way this works is literally just pulling from the DB a list of all users and all of their sleep, I believe. That is probably no longer scalable.