[Tickets #6972] mailbox listing speed-up
bugs at horde.org
bugs at horde.org
Tue Jun 24 19:49:12 UTC 2008
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/6972
------------------------------------------------------------------------------
Ticket | 6972
Created By | ziba at umich.edu
Summary | mailbox listing speed-up
Queue | IMP
Version | 4.2
Type | Enhancement
State | New
Priority | 2. Medium
Milestone |
Patch | 1
Owners |
+New Attachment | Tree.php.diff
------------------------------------------------------------------------------
ziba at umich.edu (2008-06-24 15:49) wrote:
After our recent horde/imp upgrade at umich, we've seen login times rise
from ~5-10 seconds to ~10-30 seconds. The bulk of this time is spent
building the mailbox list in IMP_Tree (imp/lib/IMAP/Tree.php). We've
made some changes which dramatically reduce the IMP_Tree startup time
and would love some feedback and basic sanity checking before we move
forward with them.
On an unloaded test server in our environment, imap_getmailboxes and
imap_list commands can take up to 1.7 seconds each against our Cyrus system.
First, IMP_Tree calls imap_getmailboxes for each namespace with a %
appended to get one level deep of subfolders.
Second, IMP_Tree::_initSubscribed executes imap_list for each namespace
with an * appended to get all sublevels of folders.
Last, it recursively crawls each folder found during the first set of
imap_getmailboxes and calls imap_getmailboxes on each folder with %
again until all branches have been plumbed.
Our improvements are premised on the fact that one level searches (%)
and searches which return full trees of results (*) actually take the
same time to return from Cyrus. So we are bypassing all other searches
and starting off with one single full (*) search from the root of the
user's mailbox.
One quirk we had to side step then was that % searches will return
objects for folders which have children that can't be directly accessed
themselves. The * search will not.
So we just iterate through the php data structure and detect parentless
children and fake up an object for them. Then, if tree_view is turned
on, we separate non-personal mailboxes into IMPTREE_OTHER_KEY and
IMPTREE_SHARED_KEY.
Since the list of folders at this point has all the children, we bypass
the recursive calls to expand.
More information about the bugs
mailing list