QCString construction

George Staikos staikos at kde.org
Sat Feb 10 02:22:13 CET 2007


On 9-Feb-07, at 8:16 PM, David Faure wrote:

> This leads me to 3 patches.
>
> One for kmail, I wrote a utility function for creating a QCString  
> from char*+size, and used that
> when creating a QCString from a DwString where it matters (i.e.  
> where I found pretty large strings
> to be used when attaching large files).
> Can a kmail developer review the change to KMMessage::asString()  
> and asSendableString(), too?
> It avoids a asString() (Assemble) and a fromString (Parse), but I  
> hope it's doing the right thing.

   IIRC there are lots more cases of mimelib doing things like this  
including in the internals.

> And one for mimelib, not really related to QCString: am I right  
> that memcpy is faster than for (i=0; i < pos1; ++i) *to++ = *from++; ?
> At least in gdb it seems faster, but I didn't benchmark it.  
> Hopefully memcpy is done by a single CPU instruction or something,  
> right?

    memcpy() is often implemented with vector operations so it should  
definitely be faster in many cases.

--
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/





More information about the Kde-optimize mailing list