Hello,

While looking through the code yesterday, I had an idea for an IMAP SEARCH
speedup for 2.0.x - that is, using the current code and the current
storage, with no changes.

I don't have the time to implement it now, so I'm publishing it here -
perhaps someone will want to do this...

Currently, the code uses db_fetch_headers() for every message in the
search cycle. Despite the name, this function actually parses the entire
message, multipart boundaries and all. (Misleading function names are
possibly the worst thing about this code...)

But, for header field searches, one could do with only parsing the main
header. This action is already available in the current code, as
db_get_main_header(); but it is only used for IMAP FETCH.

Calling db_get_main_header() instead of db_fetch_headers() in the search
loop, when searching for a field in the header, can be a serious speedup.
And it only involves minor code changes, so it's good the for 2.0.x line.

Yours, Mikhail Ramendik



Reply via email to