belaudiobooks / website

Catalog of belarusian audiobooks
GNU General Public License v3.0
32 stars 6 forks source link

Optimize DB performance #114

Open nbeloglazov opened 11 months ago

nbeloglazov commented 11 months ago

Website is not very well optimized wrt to rendering speed. It takes >1s for the main page to render while 404 page renders under 200ms. It's probably caused by unoptimized database queries. I enabled django-debug-toolbar and it shows 100+ queries to render the main page. Going through https://docs.djangoproject.com/en/4.2/topics/db/optimization/ and applying recommendations should help significantly to reduce number of queries.

nbeloglazov commented 9 months ago

After #124 I see 400ms "waiting for server response". Improvement 1s => 400ms! We should at some point log server-side rendering (and client-side rendering) times and track them.