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

Cache get_project #8231

Merged
merged 1 commit into from Jun 2, 2021
Merged

Cache get_project #8231

merged 1 commit into from Jun 2, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jun 2, 2021

This little one is being executed several times in several views.

@stsewd stsewd requested a review from a team June 2, 2021 22:20
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple enough. Let's make sure to have a QA item to ensure this actually reduces those calls.

@stsewd
Copy link
Member Author

stsewd commented Jun 2, 2021

Simple enough. Let's make sure to have a QA item to ensure this actually reduces those calls.

I tested this locally while refactoring some views in .com, it reduces 7 queries in the new sharing views. But this one is also called multiple times on the same views on .org https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/projects/views/private.py. Not sure if we can test that in production (no django toolbar), other than looking at newrelic I guess.

@stsewd stsewd merged commit f32ba4d into master Jun 2, 2021
@stsewd stsewd deleted the cache-project branch June 2, 2021 22:39
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

Successfully merging this pull request may close these issues.

None yet

2 participants