A.L.E.C wrote:
Hi! I have another great patch from my performance fixes set ;) I've observed that when message is displayed (with disabled cache) we have:
- FETCH for headers
- FETCH for message (body) structure
- one FETCH for each message/attachment part (it really sucks when
message contains several attachments) 4. FETCH for body
So, here's the patch which joins 1. and 2. into one command call and joins all fetches from 3. into one command call. Speed up is significant for all messages, specially for those having many attachments. Imagine a message with ten attachments. Previously there was ca.10 + 3 fetches * 0.2 sec. (in my mailbox with ca.800 messages) = 2.6 sec. Now, only 3 fetches * 0.2 = 0.6 sec.
It looks good so far. With this changes we'll always fetch the BODYSTRUCTURE when reading the message headers. Well this is actually some overhead, especially when just listing a mailbox. The message structure is only needed when a message is displayed and the new mechanism will probably fetch too much data that is never used. It reduces the number of fetches but one FETCH command will probably take longer because the bodystructure has do be created by the IMAP server.
Don't get me wrong, these are just some worst-case thoughts and I didn't do any speed-tests on my environment so far. I just question your calculations about the performance improvements. The 10+3 fetches on a 800 message mailbox only occur if you open all of those mails but not when they're just listed.
Combining all fetches for message part headers (3.) is a very good improvement which will surely speed up the app without any side-effects.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/