A.L.E.C wrote:
Attached patch is a body prefetching proof of concept.
For those who want to test my patch. To make testing simpler, comment console in imap.inc. Then apply my second patch. Now open a few messages and check logs/console. You'll find there time spent for fetching message contents. "(prefetch used)" is added when prefetched body was used for display, it means, there was one FETCH less. After some tests with modified imap.inc, you can replace it with the old one and open again the same messages. Then you can just compare results.