[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: Displaying large message takes loooong
From: Don Sanders <sanders () kde ! org>
Date: 2002-10-14 14:22:13
[Download RAW message or body]
On Monday 14 October 2002 22:35, Marc Mutz wrote:
> On Monday 14 October 2002 14:00, Don Sanders wrote:
> <snip>
>
> > I don't see why replace should be the bottleneck given the fact
> > that this would just be one more copy of the message on top of
> > several others.
>
> QCString operations are always _very_ _very_ slow. Please remember
> the case where KMSender performance went down the drain because we
> moved from QString::replace( "\n", "\r\n" ) to QCString::replace(
> "\n", "\r\n" );
Yes I vaguely remember that. But surely a
QCString::replace( "\n", "\r\n" );
on a <1MB message (with 1 MB free) should only take a fraction of a second.
The implementation in qcstring.cpp looks pretty optimized.
For a quick solution
result = result.replace( "\r\n", "\n" );
could just be replaced by looping over result modifying it and then truncating it.
That would require an insignificant amount of memory and should only take
milliseconds for a 1MB message.
> Martin, can you recompile with the
> #if QT_VERSION <something>
> foo.replace
> #else
> foo.replace
> #endif
> commented out in kmmsgpart.cpp?
I'm interested in also seeing the output of a
--- kmmsgpart.cpp 2002/10/12 07:59:50 1.85.2.2
+++ kmmsgpart.cpp 2002/10/14 14:03:48
@@ -316,7 +316,9 @@ QCString KMMessagePart::bodyDecoded(void
<< mBody.size() << " ). Result truncated!" << endl;
len = oit - result.begin();
result.truncate( len ); // adds trailing NUL
+ kdDebug(5006) << "start " << \
(QTime::currentTime().second()*1000)+QTime::currentTime().msec() << k_funcinfo << \
endl; result = result.replace( "\r\n", "\n" );
+ kdDebug(5006) << "end " << \
(QTime::currentTime().second()*1000)+QTime::currentTime().msec() << k_funcinfo << \
endl; break;
}
default:
(Martin feel free to email the entire message to sanders@kde.org)
Don.
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic