[cvs] commit: imp/lib/IMAP MailboxCache.php

Michael M Slusarz slusarz at horde.org
Fri Mar 9 01:09:04 UTC 2007


slusarz     2007-03-08 20:09:04 EST

  Modified files:
    lib/IMAP             MailboxCache.php 
  Log:
  Much improved mailbox caching algorithim when using data compression.  Best
  way to describe is using before/after:
  
  Before: We would take the entire mailbox cache array (contains 1 entry for
  each UID) and run the entire array through our compression algorithim when
  storing.  Thus, we had to do
  a decompress on each page load for the entire data structure.  As an offshoot,
  we further had to serialize internal complex data structures since the
  libraries may not be available when we were unserializing at the beginning of
  a session.
  
  Now: We compress each UID separately.  Then we only decompress as needed.  We
  use the same amount of memory at the beginning (serialzing an array which
  consists of compressed strings adds a negligble amount of overhead) and use
  much less memory during the access since we only need to decompress a small
  portion of the array (for example, a mailbox of thousands of messages will
  only have 20-30 or so entries decompressed because that is all that is needed
  for a mailbox view generally).  Additionally, these decompressed chunks are
  much smaller so the compression algorithim takes much less memory to decompress.
  
  Deleting messages now requires no decompression at all since we just have to
  delete the UID entry in the array.
  
  BTW, compression is not as important for UI purposes since that will always
  be done at the end of a session - after all content has already been sent - so
  an end user won't recognize any slow downs regardless.  But decompression is
  done while building the page.
  
  Revision  Changes    Path
  1.84      +91 -68    imp/lib/IMAP/MailboxCache.php

  Chora Links:
  http://cvs.horde.org/diff.php/imp/lib/IMAP/MailboxCache.php?r1=1.83&r2=1.84&ty=u


More information about the cvs mailing list