zulip / zulip

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
https://zulip.com
Apache License 2.0
21.37k stars 7.76k forks source link

Eliminate expensive and potentially unnecessary `GET /json/users` call in /#administration page #3734

Open timabbott opened 7 years ago

timabbott commented 7 years ago

Currently, page_params sends down the realm_users data structure, which in turn is sourced from zerver/models.py:active_user_dicts_in_realm, an efficiently cached data structure containing (1) only active users and (2) no avatar URLs or bot owners, but otherwise the same data that GET /json/users returns. It seems like we could make the following changes:

On chat.zulip.org, the GET /json/users call takes about 500ms, so this could be a significant performance win if done right.

showell commented 7 years ago

update: We now have avatar_source and avatar_version in active_user_dict_fields.

timabbott commented 7 years ago

Cool, converted to checkboxes and added that :)

HarshitOnGitHub commented 7 years ago

Was going to open an issue for this. Realized that this should be done while working on PR #3597. Will start working on this after completing some of the remaining issues on my TODO.

timabbott commented 6 years ago

The active_user_dict_fields object is now called realm_user_dict_fields, and we've completed most of this. It probably would not be a ton of work to finish this.