Skip to content

Performance optimizations#690

Draft
otargowski wants to merge 4 commits intosio2project:masterfrom
otargowski:performance
Draft

Performance optimizations#690
otargowski wants to merge 4 commits intosio2project:masterfrom
otargowski:performance

Conversation

@otargowski
Copy link
Copy Markdown
Contributor

Various performance enhancements mostly (entirely?) related to DB queries.
The first commit replaces #613.

As for select_related vs prefetch_related I decide mostly based on whether an object behind a foreign key will be duplicated many times according to the following excerpt from some docs:
"One difference to note when using prefetch_related is that objects created by a query can be shared between the different objects that they are related to i.e. a single Python model instance can appear at more than one point in the tree of objects that are returned. This will normally happen with foreign key relationships. Typically this behavior will not be a problem, and will in fact save both memory and CPU time."

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant