logo       

Re: extragear/graphics/kst/kst/datasources/ascii: msg#00249

kde.kst

Subject: Re: extragear/graphics/kst/kst/datasources/ascii

As I understand it the reserve method simply pre-allocates
some space. This is really only useful if you know you're
going to be building up a string a few characters at a time
(resulting in many allocations). In this case we are reading
a line of text and so only one allocation should be made, so
we gain nothing by doing the reserve (except another call and
most likely using more space than we actually need).

-----Original Message-----
From: George Staikos [mailto:staikos@xxxxxxx]
Sent: Monday, July 25, 2005 11:03 AM
To: kst@xxxxxxx
Subject: Re: [Kst] extragear/graphics/kst/kst/datasources/ascii


On Friday 22 July 2005 17:59, Andrew Walker wrote:
> -#if QT_VERSION >= 0x030200
> - ignore.reserve(1001);
> -#endif

Why was this call removed? The profiler told me that we were mallocing
when
we could guess that we didn't need to, and this helped. I know that there
is
a chance of concatenations with the new code, but I think that's a corner
case, and even then, this won't hurt it.

--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
_______________________________________________
Kst mailing list
Kst@xxxxxxx
https://mail.kde.org/mailman/listinfo/kst


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise