zulip/zulip

limited guests: Optimize get_recipients_for_user_creation_events

Open

#27,835 建立於 2023年11月22日

在 GitHub 查看
 (3 留言) (0 反應) (1 負責人)Python (19,672 star) (7,339 fork)batch import
area: performancearea: settings (user groups)help wantedin progress

描述

In #27544, whenever a limited guest tries to send a DM to another user, we end up doing a fairly expensive get_accessible_user_ids check, as noted in https://github.com/zulip/zulip/pull/27544#discussion_r1401550500.

Ideally, we'd not do that. I think the best solution might start with #25713, which would allow us to start by checking if we have an existing Huddle object, and if so, skip doing any further authorization check; that would change this from an "every DM" performance issue, which might result in annoying latency, to a "First DM in a new Huddle" one.

But since #25713 might take some time to get organized for, it might make sense to look at just optimizing the queries to filter to the set of relevant users; that'll still be useful even if we do that too.

貢獻者指南