Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta: 📈 Performance #943

Closed
16 tasks done
Tracked by #886
ulliholtgrave opened this issue Sep 23, 2021 · 4 comments
Closed
16 tasks done
Tracked by #886

Meta: 📈 Performance #943

ulliholtgrave opened this issue Sep 23, 2021 · 4 comments
Assignees
Milestone

Comments

@ulliholtgrave
Copy link
Member

ulliholtgrave commented Sep 23, 2021

Motivation

Our current code basis includes a lot of duplicate calls to our database. They should be removed towards an efficient performance level.

Proposed Solution

Check the following:

  • Redundant calls for object properties (e.g. page.default_translation called multiple times)
  • Redundant calls for foreign keys (e.g. page.translations.X ... e.g. page.translations.Y in the same model)
  • Redundant calls for methods with the same arguments (e.g. get_translation('de') ... get_translations('de'))

For more insight into the topic, you might want to read: https://docs.djangoproject.com/en/3.2/topics/performance/

For the following models the views, templates, models and api should be examined. Furthermore, their respective occurrence in utils should be investigated.

@svenseeberg
Copy link
Member

svenseeberg commented Sep 24, 2021

FYI: one quick way to display executed SQL queries is adding a a logger to the settings.py:

        "django.db.backends": {
            "level": "DEBUG",
            "handlers": [],
        },

@membralala
Copy link
Contributor

FYI: A while ago I closed #944 without further ado, however meanwhile I found, that there are some cases, where there are duplicated queries in the same call. In this cases it seems, that using djangos @cached_property fixes this and even reduces the loading times, when redis is active.

@ulliholtgrave
Copy link
Member Author

We may consider to cache the result or Matomo requests

@svenseeberg svenseeberg removed this from the Version 1.1 milestone Feb 19, 2022
@svenseeberg svenseeberg added this to the Version 1.2 milestone Feb 19, 2022
@svenseeberg svenseeberg modified the milestones: Version 1.2, Meta Issues Apr 6, 2022
@svenseeberg
Copy link
Member

svenseeberg commented Apr 6, 2022

@ulliholtgrave I removed the "statistics" from the list as we do not have any relevant database calls in our CMS regarding statistics. Right? This issue is then basically "done". We also do not have any performance issues right now.

@timobrembeck timobrembeck removed 💡 feature New feature or request ⁉️ prio: low Not urgent, can be resolved in the distant future. labels Sep 19, 2022
@timobrembeck timobrembeck changed the title Remove redundant database calls Meta: 📈 Performance Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants