karrot-dev / karrot-frontend

We migrated to https://codeberg.org/karrot/karrot-frontend
https://codeberg.org/karrot/karrot-frontend
427 stars 178 forks source link

Backend performance improvements #2667

Closed nicksellen closed 10 months ago

nicksellen commented 11 months ago

Due to https://github.com/karrot-dev/karrot-frontend/issues/2666 we have silk profiling available in prod again, I started noticing a few of the slower requests.

/api/bootstrap/ is slowed down as we have not followed the versatileimagefield performance steps on https://django-versatileimagefield.readthedocs.io/en/latest/improving_performance.html to create thumbnails post_save. At the moment it has to do a lot of checking to see if the thumbnails exist yet (that info is stored in redis cache). See profile.

The bootstrap sql queries could be improved too. Fetching less data would make a lot of sense, but that might need changes to the frontend data fetching to fetch some things on demand. At the moment we load all group infos, even if groups are inactive.

nicksellen commented 11 months ago

Sentry also seems to log slow SQL queries now, see https://karrot-dev.sentry.io/issues/?project=147126

nicksellen commented 10 months ago

I think I can call this resolved now, from various adjustments over the last few weeks:

It would always be nice to be faster, /api/bootstrap/ is still too slow if you are part of many larger groups, so future improvements could still be: