Re: Faster way of making long string?



On Sun, 24 Apr 2005 19:51:01 +0200, Ekkehard Domning <edo@xxxxxxxx>
wrote:

>Hello
>
>J French wrote:
>> This is just delegating the inefficiency to TStringList

>as You see, Ian made a test and shows that the stringlist method is running at
>double speed as his approach. I would define "inefficiency" a bit different.

Check Chris Willig's example
- and that could be made faster by aggressive increasing of the buffer
size (eg: Len := Len * 2 )

>At the end of the discussion comes the question about the code. Should the
>code be "fast" or "maintainable".

It should be both
- but even more important, it should not be obscure
- creating a TStringList when you want one long string is 'indirect'

>Since we have very fast computers, and a lot
>of ram, I like it to have maintainable code, where ever it is possible.

Agreed

>If You compare the solution with a the stringlist and the solution chris
>suggest, I would choose, nearly in all cases, the stringlist alternative. It
>might be neccessary optimize on speed if zillions of string must be added, but
>until now I allways worke with stringlist.

This is not meant to be personal, but I have noticed that a lot of
Delphi coders are not really that familiar with working with Strings.
- because they are really a fairly recent addition to the language

Where you would use a TStringList I would probably use a dynamic array
or just one long string.

Obviously, I have a large library of string manipulation routines that
started life well before Delphi - in DOS BASIC and ASM

.



Relevant Pages

  • Re: quick print type debugging
    ... putting code in a string (editors treat it like a string rather ... You get it all with d2, but you have the inefficiency of eval ... later down the road we get the ability to convert a Proc back ... Mail has the best spam protection around ...
    (comp.lang.ruby)
  • Re: string concatenation efficiency
    ... > There is always much discussion on the inefficiency of vb string ... > a report string for debugging purposes. ... Yes, string concatenation is not highly ... you're comparing 2 integers). ...
    (microsoft.public.vb.general.discussion)
  • Re: Faster way of making long string?
    ... Rather than IntToStr I would use: ... - it saves a string creation in IntToStr ... >it becomes "obscure". ... >> Delphi coders are not really that familiar with working with Strings. ...
    (alt.comp.lang.borland-delphi)
  • Re: Faster way of making long string?
    ... Since we have very fast computers, and a lot of ram, I like it to have maintainable code, where ever it is possible. ... If You compare the solution with a the stringlist and the solution chris suggest, I would choose, nearly in all cases, the stringlist alternative. ... It might be neccessary optimize on speed if zillions of string must be added, but until now I allways worke with stringlist. ...
    (alt.comp.lang.borland-delphi)