= Description = The getSubscribers function in Page.py tests every user's permission to read the page in question, rather than only testing the permission of the users who actually are subscribed to the page. If the permission test is slow (in my case, it involves an LDAP query to a remote server) and there are many users, this can create a '''huge''' performance penalty on '''every''' non-trivial change to the wiki. == Steps to reproduce == ## Describe the steps needed to reproduce the bug. If we can't reproduce it, we probably can't fix it. 1. Have a wiki with 1400 registered users. 1. Have a slow permission function (say, one requiring an LDAP lookup). 1. Save a page to which no one subscribes. 1. Wait a long time while the save completes. == Fix == Change page.py as follows (based on the [[http://hg.thinkmo.de/moin/1.5/file/e73577719048/MoinMoin/Page.py|current 1.5 code in Mercurial]]): {{{ @@ -936,9 +936,7 @@ if not subscriber.email: continue # skip empty email addresses if trivial and not subscriber.want_trivial: continue # skip uninterested subscribers - if not UserPerms(subscriber).read(self.page_name): continue - - if subscriber.isSubscribedTo(pageList): + if subscriber.isSubscribedTo(pageList) and UserPerms(subscriber).read(self.page_name): lang = subscriber.language or request.cfg.language_default if not lang in subscriber_list: subscriber_list[lang] = [] }}} This way, only users who are subscribed to the page have their permissions checked. = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: JohannesBerg * Status: fixed in 1.7: http://hg.moinmo.in/moin/1.7/rev/f048c3edc164 ---- ## If you are a moin core developer, replace the category to Category* in these cases: ## Category MoinMoinNoBug - if this is not a bug. ## Category MoinMoinBugConfirmed - if you can confirm the bug on current code. ## Category MoinMoinBugFixed - after the bug is fixed in current code. CategoryMoinMoinBugFixed