Skip to content

Conversation

@0xUnicorn
Copy link
Contributor

Change template to loop through prefetched member list for each column, instead of making new queries.

Before

  • default 165.93 ms (589 queries including 585 similar and 158 duplicates )
  • DOMContentLoaded: 1.39 s

After

  • default 54.87 ms (143 queries including 137 similar and 4 duplicates )
  • DOMContentLoaded: 471 ms

Future
We can get the queries down to 10 if we annotate the count of unnamed_members and regular_members

{% if team.unnamed_members %}
{% if team.unnamed_members.count < team.regular_members.count %}Plus {% endif %}<b>{{ team.unnamed_members.count }}</b> anonymous member(s).
{% endif %}

Change template to loop through member list for each column, instead of making new queries.
@0xUnicorn 0xUnicorn changed the title Prefetch and Select related objects in the view. Prefetch and Select related objects in the PeopleView. Jan 29, 2026
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