Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core
Commits: 69c66a39 by Abhilash Raj at 2021-02-08T09:39:52-08:00 Improve the lookup of Members. Upon investigating reasons for why the Members API is so slow, it was found that when trying to get a User associated with a Member, the Member model would do a database query every time, and not caching the result. So, anytime someone runs `member.user` or `member.display_name` or any attribute that accesses's member.user, that results in a database lookup if the Member was subscribed with their address. Subscribing via address is also the most common case and hence the slow response form the API server. Looking closely at the implementation of `user_manager.get_user` it just looks up the Address that you just passed and returns the addres' user. - - - - - d6e7bd83 by Abhilash Raj at 2021-02-09T03:54:43+00:00 Merge branch 'member-lookup' into 'master' Improve the lookup of Members. See merge request mailman/mailman!776 - - - - - 2 changed files: - src/mailman/docs/NEWS.rst - src/mailman/model/member.py Changes: ===================================== src/mailman/docs/NEWS.rst ===================================== @@ -15,7 +15,9 @@ Here is a history of user visible changes to Mailman. (2021-XX-XX) - +REST +---- +* Improve the speed of Members lookup via REST API. (Related to #700) .. _news-3.3.3: ===================================== src/mailman/model/member.py ===================================== @@ -146,7 +146,7 @@ class Member(Model): """See `IMember`.""" return (self._user if self._address is None - else getUtility(IUserManager).get_user(self._address.email)) + else self._address.user) @property def subscriber(self): View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/8b2a06554747222c588f9a1ceb9a227f69a61135...d6e7bd8367ad80135f49747f70a7f26d96585bde -- View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/8b2a06554747222c588f9a1ceb9a227f69a61135...d6e7bd8367ad80135f49747f70a7f26d96585bde You're receiving this email because of your account on gitlab.com.
_______________________________________________ Mailman-checkins mailing list -- mailman-checkins@python.org To unsubscribe send an email to mailman-checkins-le...@python.org https://mail.python.org/mailman3/lists/mailman-checkins.python.org/ Member address: arch...@jab.org