[Kst] extragear/graphics/kst/kst/datasources/ascii

Andrew Walker arwalker at sumusltd.com
Fri Jul 29 17:44:42 CEST 2005


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 at kde.org]
Sent: Monday, July 25, 2005 11:03 AM
To: kst at kde.org
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 at kde.org
https://mail.kde.org/mailman/listinfo/kst



More information about the Kst mailing list