lionleaf / dwitter

Social network for short js demos
https://www.dwitter.net
Apache License 2.0
764 stars 69 forks source link

Only annotate num_likes on Top views #482

Closed stianjensen closed 4 years ago

stianjensen commented 4 years ago

The num_likes annotation is quite heavy, so avoiding it on pages where it is not used seems smart.

With this, only the TopAllDweetFeed view should be particularly slow, hopefully (the rest of the top views are fast since they start by filtering out a lot of data based on posted at date before doing their sorting).

When opening your Pull Request, we encourage you to do the following (you can add an X to check each task):

stianjensen commented 4 years ago

I think some tests will fail here, because they ensure that num_likes is always set. So I'll update those.