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

Don't do extra query if the project is a translation #6865

Merged
merged 2 commits into from Apr 7, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Apr 6, 2020

We only check for superprojects if the project isn't a translation.
This reduces a query

Ref #6455

We only check for superprojects if the project isn't a translation.
This reduces a query
@stsewd
Copy link
Member Author

stsewd commented Apr 6, 2020

Failure on travis is unrelated

@stsewd stsewd requested a review from a team April 6, 2020 19:45
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.

I like the refactor 👍

else:
projects.append(project)
projects = projects or set()
projects.add(project)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this logic changed? It feels less clear to me.

stsewd added a commit that referenced this pull request Apr 7, 2020
This together with:
- #6867
- #6865
- #6864

reduces a lot of queries and without changing the current UI.

This is a benchmark using the django debug toolbar:

Before: 138 queries with 7 subprojects, 17 queries per each additional subproject

With all the changes: 28 queries with 7 subprojects, 1 query per each additional subproject
@stsewd
Copy link
Member Author

stsewd commented Apr 7, 2020

Failure is unrelated

edit: travis is working again 🤷‍♂️

@stsewd stsewd merged commit 98755fd into master Apr 7, 2020
@stsewd stsewd deleted the dont-do-extra-query branch April 7, 2020 02:04
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