[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-optimize
Subject:    Re: QCString construction
From:       Roger Larsson <roger.larsson () norran ! net>
Date:       2007-02-10 17:33:24
Message-ID: 200702101833.25106.roger.larsson () norran ! net
[Download RAW message or body]

On Saturday 10 February 2007 01:43, David Faure wrote:
> I was debugging today the memory consumption by kmail (qt3) when sending
> signed emails with large attachments. Among other things, I noticed many
> QCString(const char*) constructions in kmail, like: QCString
> KMMessage::asString() const {
>    return asDwString().c_str();
> }
> and
> messagecomposer.cpp: mEncodedBody = dwPart->AsString().c_str();

The fastest string copy is not doing it at all...
Why is code like this necessary? Why returning a low level c_str?
If it is why does it have to be in a hot path?

I have been guilty of optimizing code that is rarely used resulting in
- less readable code
- more prone to errors
- harder to optimize later
- for very little real world gain...

(I will check your patches)

/RogerL
_______________________________________________
Kde-optimize mailing list
Kde-optimize@kde.org
https://mail.kde.org/mailman/listinfo/kde-optimize
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic