Bug 55369 - slow display of big IMAP mails
Summary: slow display of big IMAP mails
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-01 09:52 UTC by Nicolae Mihalache
Modified: 2007-09-14 12:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolae Mihalache 2003-03-01 09:52:41 UTC
Version:            (using KDE KDE 3.1)
Installed from:    SuSE RPMs
OS:          Linux

Hello!

When clicking on a message that has an attachemnt of about 4MB kmail takes no less than 28 seconds to display the message. During these 28 seconds the progressbar shows 0%. After 28 seconds the progress-bar goes in  less than one second from 0% to 100% and the message is displayed. I've looked with a top and during these 28 seconds there are two processes in top consuming each about 50% of the CPU: kmail and kdeinit. This suggest that my CPU (Pentium III 700 MHz) is too slow for Kmail. However when using mozilla, the mail display goes much faster and the 10Mbit network is the bottleneck, not the CPU.
This problem doesn't happend only with a specific message, all the messages that are relatively big are very slow to display.
The IMAP server is Cyrus.

Nicolae
Comment 1 patrick 2003-04-03 23:39:07 UTC
I can confirm this behaviour. Retrieving a 36,9MB (!) mail from an IMAP 
Server behind a DSL connection becomes so slow, that the DSL line 
(1MBit/s) is NOT the bottleneck. 
 
After clicking on the mail CPU usage ramps up slowly (over the course 
of 10-15 seconds) until it reaches 100% at which point the network 
transfer slowly starts to slow down until it reaches approximately 20K/s 
(Normally I can transfer with ca. 120K/s from the IMAP server). 
 
When the download itself has finished KMail needs another 3 minutes 
until the message can be displayed (NB: AMD Thunderbird 1200, 
512MB RAM, 1GB swap, no swapping during the whole process, and 
the machine is otherwise idle), and scrolling in the message (no 
attachment, the mail has a 36MB Body) pegs the CPU to 100% for 
several seconds at a time. 
 
Note: Mozilla does not really do any better, it degrades even further... 
 
Granted: this is not the average eMail, and does not happen often, but 
maybe it is possible to somehow speed this up? 
 
System: KDE 3.1.1 on Debian SID 
 
Patrick 
 
Comment 2 Stefan Rompf 2003-04-12 12:29:55 UTC
Just wanted to report the same bug, with some additional infos. The time is spent in 
the following backtrace: 
 
realloc() 
QGArray::resize(unsigned, Optimization = MemOptim) 
QGArray::resize(unsigned) 
QBuffer::writeBlock 
KMFolderImap::slotSimpleData 
 
On my system (CVS HEAD), slotSimpleData receives the mail in 8192 byte chunks. 
QBuffer::writeBlock copies the complete data on every call, resulting in an O(n!) 
workload with n being equivalent to mail size. 
 
Comment 3 Christian Plessl 2003-05-12 12:30:50 UTC
I'm experiencing similar performance problems. The display of mails with large 
attachements is very slow, other mail clients, e.g. sylhpeed are much faster. If I copy 
the mail from the IMAP server to a local mail directory the displaying of the mails is 
as fast as expected. 
 
The network performance to the mail server should not be a problem. Using scp to 
transfer large files from the mailserver to my machine results in transfer speeds of 
about 3Mb/sec. IMAP server is UW IMAP 2002.325. 
KMail Version is 1.5.1 (on KDE 3.1.1a, on Gentoo Linux, Intel x86). 
 
Comment 4 Carsten Burghardt 2003-08-31 12:49:29 UTC
Load attachments on demand (kde 3.2) fixes this