[fpc-pascal] String buffer

Honza befelemepeseveze at gmail.com
Wed Feb 10 14:12:43 CET 2010


On Tue, 9 Feb 2010 10:45:55 -0300, Fl?vio Etrusco wrote:

> Some (hopefully constructive) commentaries (and then I would suggest
> to add to LCL or FCL):
> 1) It could be called really TStringBuffer;
> 2) The 'W' methods could be called 'Append';
> 3) The GetS method could truncate the string to avoid the copy, as I
> think the common use will not be Append+Read+Append+Read, but
> Append+Append+...+Read...

I agree in all points, even while having some more ideas on the
naming. If it will be considered for FCL, then let the dev team pick
identifiers of their choice and any other changes/improvements - I'll
be happy to implement them if needed.

On Wed, 10 Feb 2010 09:49:30 +0200 Graeme Geldenhuys wrote:

> Could you explain what the advantages are of
> that string buffer object compared to a standard string types like
> AnsiString or TStringList?

I guess some memory and/or time could be saved in certain usage
patterns compared to TSTringList and String. There is now a dumb
benchmark on the blog, but nobody should trust other's benchmarks :)

http://freepascal-bits.blogspot.com/2010/02/string-buffer-performance.html

-bflm



More information about the fpc-pascal mailing list