[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Speeding up elmo-folder-synchronize



Hi,

I am looking at speeding up IMAP search a bit. Having got solr+dovecot
to work on my mail, I am looking at speeding up WL a bit.

I noticed that elmo-folder-synchronize has an optional MASK param:

  If optional argument MASK is specified and is a list of message
  numbers, synchronize messages only which are contained the list.

However, the default implementation of elmo-folder-synchronize calls
elmo-folder-list-messages, which retrieves all message numbers.  If
mask is defined, then many of these numbers are thrown away. If this
is a large mailbox (and I want to search mailboxes with > 100k
messages) it takes some time to get back all the UIDs.

It seems to me sufficient to request from IMAP not all messages, but
only those in the mask param, then diff this list with the union of
mask and message numbers in the msgdb. This will give us new (not in
msgdb) or deleted messages without the overhead of fetching all
message UIDs.

Unfortunately I have only implemented this as an IMAP only hack for
the moment.  The best way I think would be to pass the mask param down
to elmo-folder-list-messages, but this would mean more comprehensive
changes.

Those who understand ELMO/WL more than I, if you have a chance, could
you give feedback? New method definition is attached. Thanks.

I notice that this also changes the behavior, when viewing a filter
folder with an IMAP target having many messages, of calling `s all`
(wl-summary-sync all). Before this new definition, WL will warn you
that the folder has too many messages, though the filter folder may
have very few, and spends a long time building a message db. Now it is
much faster & will only retrieve those messages which match the
filtered condition.

best, Erik

Attachment: elmo_faster_synchronize.el
Description: Binary data

Attachment: pgpA1X_i0vhRt.pgp
Description: PGP signature